summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-07 21:36:02 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-07 21:36:02 +0000
commitf32527879972854cbe2f43949428120791d3c697 (patch)
treed8146800194baf3ce4b103979e4090c9dab6ffc9
parentf09c2dc8e06480d962cea7bfd5562575bdf168ae (diff)
downloadbcm5719-llvm-f32527879972854cbe2f43949428120791d3c697.tar.gz
bcm5719-llvm-f32527879972854cbe2f43949428120791d3c697.zip
Fix PR clang/3291
llvm-svn: 61886
-rw-r--r--clang/lib/Sema/SemaDecl.cpp6
-rw-r--r--clang/test/SemaCXX/qualified-id-lookup.cpp14
2 files changed, 16 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 49719ab4f52..351694c74d1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -343,11 +343,11 @@ Decl *Sema::LookupDecl(DeclarationName Name, unsigned NSI, Scope *S,
}
}
+ if (!LookInParent && !Ctx->isTransparentContext())
+ return 0;
+
Ctx = Ctx->getParent();
}
-
- if (!LookInParent && !Ctx->isTransparentContext())
- return 0;
}
}
diff --git a/clang/test/SemaCXX/qualified-id-lookup.cpp b/clang/test/SemaCXX/qualified-id-lookup.cpp
index 0ef8e69107b..c0d1ca370d1 100644
--- a/clang/test/SemaCXX/qualified-id-lookup.cpp
+++ b/clang/test/SemaCXX/qualified-id-lookup.cpp
@@ -1,5 +1,4 @@
// RUN: clang -fsyntax-only -verify %s
-
namespace Ns {
int f(); // expected-note{{previous declaration is here}}
@@ -71,5 +70,18 @@ namespace a {
}
}
+// PR clang/3291
+namespace a {
+ namespace a { // A1
+ namespace a { // A2
+ int i;
+ }
+ }
+}
+void test_a() {
+ a::a::i = 3; // expected-error{{no member named 'i'}}
+ a::a::a::i = 4;
+}
+
OpenPOWER on IntegriCloud