]> granicus.if.org Git - clang/commitdiff
Fix lookup bug
authorAnders Carlsson <andersca@mac.com>
Sat, 28 Mar 2009 23:49:35 +0000 (23:49 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 28 Mar 2009 23:49:35 +0000 (23:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67964 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclCXX.cpp
test/SemaCXX/namespace-alias.cpp

index f58125d2e355999d79cb298af087736f65c2dcfa..300e7c450fe1f45678096aaa8d3c9777c667e015 100644 (file)
@@ -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 :
index b05db5ffe040ecc99e6cd9a742c53a5b59cb6853..87e8b2c5ddd154668d681ba3317f27bd72ef3ca9 100644 (file)
@@ -21,3 +21,7 @@ namespace F {
   using namespace A;
   namespace D = B; // expected-error {{reference to 'B' is ambiguous}}
 }
+
+namespace G { 
+  namespace B = N;
+}