diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2013-12-21 00:49:51 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2013-12-21 00:49:51 +0000 |
| commit | 7607fce11254436da15f30305a791de9755bedc7 (patch) | |
| tree | 1982c8324bdf9336f646e06e524a9ff0b174e9d4 /clang/lib | |
| parent | 2658ea9e907a9da7ed8efc2ac9c82c0790ef99be (diff) | |
| download | bcm5719-llvm-7607fce11254436da15f30305a791de9755bedc7.tar.gz bcm5719-llvm-7607fce11254436da15f30305a791de9755bedc7.zip | |
Don't mark record decls invalid when one of its methods is invalid, PR18284.
Without this patch, record decls with invalid out-of-line method delcs would
sometimes be marked invalid, but not always. With this patch, they are
consistently never marked invalid.
(The code to do this was added in
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100809/033154.html
, but the test from that revision is still passing.)
As far as I can tell, this was the only place where a class was marked invalid
after its definition was complete.
llvm-svn: 197848
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 65330dbbdec..30ec0c4e4bc 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -7176,12 +7176,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, if (!NewFD->isInvalidDecl() && NewFD->isMSVCRTEntryPoint()) CheckMSVCRTEntryPoint(NewFD); - if (NewFD->isInvalidDecl()) { - // If this is a class member, mark the class invalid immediately. - // This avoids some consistency errors later. - if (CXXMethodDecl* methodDecl = dyn_cast<CXXMethodDecl>(NewFD)) - methodDecl->getParent()->setInvalidDecl(); - } else + if (!NewFD->isInvalidDecl()) D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous, isExplicitSpecialization)); } |

