diff options
author | John McCall <rjmccall@apple.com> | 2010-08-11 23:52:36 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-11 23:52:36 +0000 |
commit | b3b50a8b2c91d21afda75c458ca7d210abf6ffbf (patch) | |
tree | 1f50269378cfb6efedbef96d663b433d442e4b21 /lib/Sema/SemaLookup.cpp | |
parent | b5049d83fd83bd0dc8b19e94b5c05f38ea64d7ce (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110882 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index a54716c679..024aa131be 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/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; |