forked from OSchip/llvm-project
Don't try to implicitly declare special members of an invalid class.
Fixes a crash in a rather large and difficult-to-reduce test case. llvm-svn: 110882
This commit is contained in:
parent
ec389da6f2
commit
2ded5d25a9
|
|
@ -469,6 +469,10 @@ static bool LookupBuiltin(Sema &S, LookupResult &R) {
|
||||||
/// the class at this point.
|
/// the class at this point.
|
||||||
static bool CanDeclareSpecialMemberFunction(ASTContext &Context,
|
static bool CanDeclareSpecialMemberFunction(ASTContext &Context,
|
||||||
const CXXRecordDecl *Class) {
|
const CXXRecordDecl *Class) {
|
||||||
|
// Don't do it if the class is invalid.
|
||||||
|
if (Class->isInvalidDecl())
|
||||||
|
return false;
|
||||||
|
|
||||||
// We need to have a definition for the class.
|
// We need to have a definition for the class.
|
||||||
if (!Class->getDefinition() || Class->isDependentContext())
|
if (!Class->getDefinition() || Class->isDependentContext())
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue