diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-04-22 18:52:25 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-04-22 18:52:25 +0000 |
commit | b65abda449dfb17aba39794be6ce41111d40fda0 (patch) | |
tree | 4b5ad774cee3d09e7f493fe788bb3127f89601ca /lib/Sema/SemaDeclCXX.cpp | |
parent | e970c60dadaf22019743724bac879dbefbc4f5e3 (diff) |
Don't enter a qualified scope for an invalid decl.
Fixes assertion later on. rdar://9122937 & http://llvm.org/PR9459
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 88193f5464..53a7c73998 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -7639,7 +7639,7 @@ bool Sema::CheckPureMethod(CXXMethodDecl *Method, SourceRange InitRange) { /// class X. void Sema::ActOnCXXEnterDeclInitializer(Scope *S, Decl *D) { // If there is no declaration, there was an error parsing it. - if (D == 0) return; + if (D == 0 || D->isInvalidDecl()) return; // We should only get called for declarations with scope specifiers, like: // int foo::bar; @@ -7651,7 +7651,7 @@ void Sema::ActOnCXXEnterDeclInitializer(Scope *S, Decl *D) { /// initializer for the out-of-line declaration 'D'. void Sema::ActOnCXXExitDeclInitializer(Scope *S, Decl *D) { // If there is no declaration, there was an error parsing it. - if (D == 0) return; + if (D == 0 || D->isInvalidDecl()) return; assert(D->isOutOfLine()); ExitDeclaratorContext(S); |