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:
John McCall 2010-08-11 23:52:36 +00:00
parent ec389da6f2
commit 2ded5d25a9
1 changed files with 4 additions and 0 deletions

View File

@ -469,6 +469,10 @@ static bool LookupBuiltin(Sema &S, LookupResult &R) {
/// the class at this point.
static bool CanDeclareSpecialMemberFunction(ASTContext &Context,
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.
if (!Class->getDefinition() || Class->isDependentContext())
return false;