ClangASTContext::ParseClassTemplateDecl doesn't always succeed.

When it does, it returns a NULL ClassTemplateDecl.  Don't use 
it if it is NULL...

<rdar://problem/35672107>

llvm-svn: 319516
This commit is contained in:
Jim Ingham 2017-12-01 03:41:30 +00:00
parent 363c631edd
commit 4e29eed498

View File

@ -786,7 +786,17 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
m_ast.ParseClassTemplateDecl(decl_ctx, accessibility,
type_name_cstr, tag_decl_kind,
template_param_infos);
if (!class_template_decl) {
if (log) {
dwarf->GetObjectFile()->GetModule()->LogMessage(
log, "SymbolFileDWARF(%p) - 0x%8.8x: %s type \"%s\" "
"clang::ClassTemplateDecl failed to return a decl.",
static_cast<void *>(this), die.GetOffset(),
DW_TAG_value_to_name(tag), type_name_cstr);
}
return TypeSP();
}
clang::ClassTemplateSpecializationDecl
*class_specialization_decl =
m_ast.CreateClassTemplateSpecializationDecl(