summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
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
commitc2fd626cac7f3ec37e26f0a5dc74beb44bb83c6e (patch)
tree6bc16f6709bee4c07431ce7348ceb00836f09534 /clang/lib/Sema
parentd6ef62f0bf93dc7825158f464cbbd723e37ddd20 (diff)
downloadbcm5719-llvm-c2fd626cac7f3ec37e26f0a5dc74beb44bb83c6e.tar.gz
bcm5719-llvm-c2fd626cac7f3ec37e26f0a5dc74beb44bb83c6e.zip
Improve recovery from ill-formed scope specifiers. Fixes PR3670.
llvm-svn: 66286
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index f4c2788217d..b25ba431496 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud