diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-01-06 22:49:11 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-01-06 22:49:11 +0000 |
commit | 9f9518265f399b50477e5198169acea1f965f13c (patch) | |
tree | 67b6cb5e925d2181d1f0b54131cba497d5140096 /clang/lib/AST/DeclBase.cpp | |
parent | 70eed364fce44a405aa5907ddd0d3f3dd2ea1ab2 (diff) | |
download | bcm5719-llvm-9f9518265f399b50477e5198169acea1f965f13c.tar.gz bcm5719-llvm-9f9518265f399b50477e5198169acea1f965f13c.zip |
PR26048, PR26050: put non-type template parameters and indirect field decls
into IDNS_Tag in C++, because they conflict with redeclarations of tags. (This
doesn't affect elaborated-type-specifier lookup, which looks for IDNS_Type in
C++).
llvm-svn: 256985
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 16394e865eb..72587e388e4 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -569,7 +569,6 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) { case Var: case ImplicitParam: case ParmVar: - case NonTypeTemplateParm: case ObjCMethod: case ObjCProperty: case MSProperty: @@ -579,6 +578,12 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) { case IndirectField: return IDNS_Ordinary | IDNS_Member; + case NonTypeTemplateParm: + // Non-type template parameters are not found by lookups that ignore + // non-types, but they are found by redeclaration lookups for tag types, + // so we include them in the tag namespace. + return IDNS_Ordinary | IDNS_Tag; + case ObjCCompatibleAlias: case ObjCInterface: return IDNS_Ordinary | IDNS_Type; |