aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-03-28 23:49:35 +0000
committerAnders Carlsson <andersca@mac.com>2009-03-28 23:49:35 +0000
commitdd729fce03899ed03a212a49d7b03e043ce6ed40 (patch)
tree6c3225f7e948115ca39bbad9a6f7d664ed102541
parentfaf0e872f3409ecafbc458eabb22be76f79cb050 (diff)
Fix lookup bug
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67964 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDeclCXX.cpp2
-rw-r--r--test/SemaCXX/namespace-alias.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index f58125d2e3..300e7c450f 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -1685,7 +1685,7 @@ Sema::DeclPtrTy Sema::ActOnNamespaceAliasDef(Scope *S,
IdentifierInfo *Ident) {
// Check if we have a previous declaration with the same name.
- if (NamedDecl *PrevDecl = LookupName(S, Alias, LookupOrdinaryName)) {
+ if (NamedDecl *PrevDecl = LookupName(S, Alias, LookupOrdinaryName, true)) {
// FIXME: If this is a namespace alias decl, and it points to the same
// namespace, we shouldn't warn.
unsigned DiagID = isa<NamespaceDecl>(PrevDecl) ? diag::err_redefinition :
diff --git a/test/SemaCXX/namespace-alias.cpp b/test/SemaCXX/namespace-alias.cpp
index b05db5ffe0..87e8b2c5dd 100644
--- a/test/SemaCXX/namespace-alias.cpp
+++ b/test/SemaCXX/namespace-alias.cpp
@@ -21,3 +21,7 @@ namespace F {
using namespace A;
namespace D = B; // expected-error {{reference to 'B' is ambiguous}}
}
+
+namespace G {
+ namespace B = N;
+}