aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-06 19:06:37 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-06 19:06:37 +0000
commit9fa14a547881e7abbe1edcdb92e6d3084be8d8bc (patch)
tree645b75545f6083a805e9d9da82194c55816c9025 /lib/Sema/SemaDecl.cpp
parentcf62d39bc2f09855c6ab08bdc5d0bf54067f0041 (diff)
Improve recovery from ill-formed scope specifiers. Fixes PR3670.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index f4c2788217..b25ba43149 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1209,7 +1209,11 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl,
}
// See if this is a redefinition of a variable in the same scope.
- if (!D.getCXXScopeSpec().isSet() && !D.getCXXScopeSpec().isInvalid()) {
+ if (D.getCXXScopeSpec().isInvalid()) {
+ DC = CurContext;
+ PrevDecl = 0;
+ InvalidDecl = true;
+ } else if (!D.getCXXScopeSpec().isSet()) {
LookupNameKind NameKind = LookupOrdinaryName;
// If the declaration we're planning to build will be a function