forked from OSchip/llvm-project
[index] Avoid another crash that happens when looking up a dependent name
in a record that has a base without a definition rdar://32224197 llvm-svn: 303192
This commit is contained in:
parent
b215d473dd
commit
d2b8aaa05a
|
@ -278,6 +278,8 @@ bool CXXBasePaths::lookupInBases(ASTContext &Context,
|
|||
dyn_cast_or_null<ClassTemplateDecl>(TN.getAsTemplateDecl()))
|
||||
BaseRecord = TD->getTemplatedDecl();
|
||||
}
|
||||
if (BaseRecord && !BaseRecord->hasDefinition())
|
||||
BaseRecord = nullptr;
|
||||
} else {
|
||||
BaseRecord = cast<CXXRecordDecl>(
|
||||
BaseSpec.getType()->castAs<RecordType>()->getDecl());
|
||||
|
|
|
@ -131,3 +131,13 @@ void undefinedTemplateLookup(UndefinedTemplateClass<T> &x) {
|
|||
x.lookup;
|
||||
typename UndefinedTemplateClass<T>::Type y;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct UserOfUndefinedTemplateClass: UndefinedTemplateClass<T> { };
|
||||
|
||||
template<typename T>
|
||||
void undefinedTemplateLookup2(UserOfUndefinedTemplateClass<T> &x) {
|
||||
// Shouldn't crash!
|
||||
x.lookup;
|
||||
typename UserOfUndefinedTemplateClass<T>::Type y;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue