summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-12-29 23:34:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-12-29 23:34:32 +0000
commitf2005d3de64f9230c6b43b4f4da1866d999446c8 (patch)
treefbeca65132ed366aae5a8e69cfac59bd1061bf2a /clang/lib/AST/Decl.cpp
parent0315920629da8a51b717cbaff05dcd2af42ea5d5 (diff)
downloadbcm5719-llvm-f2005d3de64f9230c6b43b4f4da1866d999446c8.tar.gz
bcm5719-llvm-f2005d3de64f9230c6b43b4f4da1866d999446c8.zip
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
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 243d4055840..9b43977b0bc 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -1607,6 +1607,9 @@ NamedDecl *NamedDecl::getUnderlyingDeclImpl() {
if (auto *AD = dyn_cast<ObjCCompatibleAliasDecl>(ND))
return AD->getClassInterface();
+ if (auto *AD = dyn_cast<NamespaceAliasDecl>(ND))
+ return AD->getNamespace();
+
return ND;
}
OpenPOWER on IntegriCloud