namespace aliases. Fixes PR6341.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99664
91177308-0d34-0410-b5e6-
96231b3b80d8
if (NamespaceAliasDecl *AD = dyn_cast<NamespaceAliasDecl>(PrevDecl)) {
// We already have an alias with the same name that points to the same
// namespace, so don't create a new one.
+ // FIXME: At some point, we'll want to create the (redundant)
+ // declaration to maintain better source information.
if (!R.isAmbiguous() && !R.empty() &&
- AD->getNamespace() == getNamespaceDecl(R.getFoundDecl()))
+ AD->getNamespace()->Equals(getNamespaceDecl(R.getFoundDecl())))
return DeclPtrTy();
}
// RUN: %clang_cc1 -fsyntax-only -verify %s
-namespace N { };
+namespace N { struct X { }; };
namespace A = N;
KC::func(); // expected-error {{undeclared identifier 'KC'}}
}
}
+
+// PR6341
+namespace A = N;
+namespace N { }
+namespace A = N;
+
+A::X nx;
+