[cfe-commits] r110882 - /cfe/trunk/lib/Sema/SemaLookup.cpp
John McCall
rjmccall at apple.com
Wed Aug 11 16:52:36 PDT 2010
Author: rjmccall
Date: Wed Aug 11 18:52:36 2010
New Revision: 110882
URL: http://llvm.org/viewvc/llvm-project?rev=110882&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Sema/SemaLookup.cpp
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=110882&r1=110881&r2=110882&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Wed Aug 11 18:52:36 2010
@@ -469,6 +469,10 @@
/// 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;
More information about the cfe-commits
mailing list