summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2017-12-21 21:47:22 +0000
committerPaul Robinson <paul.robinson@sony.com>2017-12-21 21:47:22 +0000
commitf183848ace53f11543eaeeaaf753d190e063f4b8 (patch)
tree2b8728c0f4911c76fa9fed2b05706777e341173b /clang/lib/AST/Decl.cpp
parenta973cc2282d4fa6f9822a87377e2c6cc28caa175 (diff)
downloadbcm5719-llvm-f183848ace53f11543eaeeaaf753d190e063f4b8.tar.gz
bcm5719-llvm-f183848ace53f11543eaeeaaf753d190e063f4b8.zip
[AST] Incorrectly qualified unscoped enumeration as template actual parameter.
An unscoped enumeration used as template argument, should not have any qualified information about its enclosing scope, as its visibility is global. In the case of scoped enumerations, they must include information about their enclosing scope. Patch by Carlos Alberto Enciso! Differential Revision: https://reviews.llvm.org/D39239 llvm-svn: 321312
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 2f51ec31a7b..ee15a4d2b4f 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -1548,7 +1548,10 @@ void NamedDecl::printQualifiedName(raw_ostream &OS,
// enumerator is declared in the scope that immediately contains
// the enum-specifier. Each scoped enumerator is declared in the
// scope of the enumeration.
- if (ED->isScoped() || ED->getIdentifier())
+ // For the case of unscoped enumerator, do not include in the qualified
+ // name any information about its enum enclosing scope, as is visibility
+ // is global.
+ if (ED->isScoped())
OS << *ED;
else
continue;
OpenPOWER on IntegriCloud