From: Anders Carlsson Date: Sat, 28 Mar 2009 23:49:35 +0000 (+0000) Subject: Fix lookup bug X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd729fce03899ed03a212a49d7b03e043ce6ed40;p=clang Fix lookup bug git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67964 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(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; +}