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 | 2ded5d25a9d4b718b249f29aa06d34fe2101e91c (patch) | |
tree | 0bcc523cc8102419a48d3b4121687484424a7cee | |
parent | ec389da6f2eb67060086e7e5d102a6ff3914c537 (diff) | |
download | llvm-2ded5d25a9d4b718b249f29aa06d34fe2101e91c.zip llvm-2ded5d25a9d4b718b249f29aa06d34fe2101e91c.tar.gz llvm-2ded5d25a9d4b718b249f29aa06d34fe2101e91c.tar.bz2 |
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
-rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index a54716c..024aa13 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; |