diff options
| author | John McCall <rjmccall@apple.com> | 2010-08-12 00:57:17 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-08-12 00:57:17 +0000 |
| commit | 12d53da8cb4bbe43bb92c38a770f2cd5b3679cd0 (patch) | |
| tree | 40da1cc5ba51813ad372362440a3111a12bb29d4 /clang/lib/Sema | |
| parent | 7d7b4d1b0f6675c50206ce1b046f9d1045042cc5 (diff) | |
| download | bcm5719-llvm-12d53da8cb4bbe43bb92c38a770f2cd5b3679cd0.tar.gz bcm5719-llvm-12d53da8cb4bbe43bb92c38a770f2cd5b3679cd0.zip | |
Fix a crash on invalid when declaring an implicit member of a class with an
invalid destructor.
llvm-svn: 110891
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index de7ad3d791d..b27f727b3c5 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3652,8 +3652,14 @@ void Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, bool &Redeclaration, bool &OverloadableAttrRequired) { // If NewFD is already known erroneous, don't do any of this checking. - if (NewFD->isInvalidDecl()) + if (NewFD->isInvalidDecl()) { + // If this is a class member, mark the class invalid immediately. + // This avoids some consistency errors later. + if (isa<CXXMethodDecl>(NewFD)) + cast<CXXMethodDecl>(NewFD)->getParent()->setInvalidDecl(); + return; + } if (NewFD->getResultType()->isVariablyModifiedType()) { // Functions returning a variably modified type violate C99 6.7.5.2p2 |

