From 2ded5d25a9d4b718b249f29aa06d34fe2101e91c Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 11 Aug 2010 23:52:36 +0000 Subject: 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 --- clang/lib/Sema/SemaLookup.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib') diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index a54716c679b..024aa131bed 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -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; -- cgit v1.2.3