<rdar://problem/13298695>
Fixed LLDB to be able to correctly parse template parameters that have no name and no type. This can be triggered by the following LLVM/Clang code:
template <typename T, typename = void>
class SmallVectorTemplateCommon : public SmallVectorBase {
The “typename = void” was emitting DWARF with an empty DW_AT_name and no DW_AT_type. We now correctly infer that no DW_AT_type means “void” and that an empty name is ok.
This means you can now call functions on things that inherit from SmallVectorTemplateCommon.
llvm-svn: 180155
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 94f4fb0..4e50793 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -1193,6 +1193,10 @@
for (size_t i=0; i<num_template_params; ++i)
{
const char *name = template_param_infos.names[i];
+
+ IdentifierInfo *identifier_info = NULL;
+ if (name && name[0])
+ identifier_info = &ast->Idents.get(name);
if (template_param_infos.args[i].getKind() == TemplateArgument::Integral)
{
template_param_decls.push_back (NonTypeTemplateParmDecl::Create (*ast,
@@ -1201,7 +1205,7 @@
SourceLocation(),
depth,
i,
- &ast->Idents.get(name),
+ identifier_info,
template_param_infos.args[i].getIntegralType(),
parameter_pack,
NULL));
@@ -1215,7 +1219,7 @@
SourceLocation(),
depth,
i,
- &ast->Idents.get(name),
+ identifier_info,
is_typename,
parameter_pack));
}