diff options
author | Paul Robinson <paul.robinson@sony.com> | 2017-12-21 21:47:22 +0000 |
---|---|---|
committer | Paul Robinson <paul.robinson@sony.com> | 2017-12-21 21:47:22 +0000 |
commit | 2f5231150cfd6f2da1e23aa0a2880ad732998903 (patch) | |
tree | b071a9608f6981bd59a166bb567c12c9ab83af09 /lib/AST/Decl.cpp | |
parent | fcc28fd8cc8139cf1e4763459447880768579d8e (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 2f51ec31a7..ee15a4d2b4 100644 --- a/lib/AST/Decl.cpp +++ b/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; |