Model NamespaceAliasDecls as having their nominated namespace as an underlying
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 29 Dec 2015 23:34:32 +0000 (23:34 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 29 Dec 2015 23:34:32 +0000 (23:34 +0000)
commitf2005d3de64f9230c6b43b4f4da1866d999446c8
treefbeca65132ed366aae5a8e69cfac59bd1061bf2a
parent0315920629da8a51b717cbaff05dcd2af42ea5d5
Model NamespaceAliasDecls as having their nominated namespace as an underlying
declaration. This fixes an issue where we would reject (due to a claimed
ambiguity) a case where lookup finds multiple NamespaceAliasDecls from
different scopes that nominate the same namespace.

The C++ standard doesn't make it clear that such a case is in fact valid (which
I'm working on fixing), but there are no relevant rules that distinguish using
declarations and namespace alias declarations here, so it makes sense to treat
them the same way.

llvm-svn: 256601
clang/include/clang/AST/Decl.h
clang/lib/AST/Decl.cpp
clang/lib/Sema/SemaCXXScopeSpec.cpp
clang/lib/Sema/SemaCodeComplete.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/SemaCXX/namespace-alias.cpp
clang/test/SemaCXX/using-decl-1.cpp