[PATCH] D39239: [AST] Incorrectly qualified unscoped enumeration as template actual parameter.

Carlos Alberto Enciso via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 06:42:43 PDT 2017


CarlosAlbertoEnciso created this revision.

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.

For the below test:

  enum unscoped { a };
  enum class scoped { b };
  
  template<unscoped U> struct tmpl_u { };
  template<scoped S> struct tmpl_s { };
  
  tmpl_u<unscoped::a> tmpl_unscoped;
  tmpl_s<scoped::b> tmpl_scoped;

gives the following encoded names:

  DW_TAG_structure_type "tmpl_u<unscoped::a>"
  DW_TAG_structure_type "tmpl_s<scoped::b>"

The incorrectly qualified name causes a debugger to show qualified
names for both scoped and unscoped enumerations.


https://reviews.llvm.org/D39239

Files:
  lib/AST/Decl.cpp
  test/Modules/odr.cpp
  test/SemaCXX/return-noreturn.cpp
  test/SemaTemplate/temp_arg_enum_printing.cpp
  test/SemaTemplate/temp_arg_enum_printing_more.cpp
  unittests/AST/NamedDeclPrinterTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39239.120062.patch
Type: text/x-patch
Size: 4597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171024/426edc49/attachment.bin>


More information about the cfe-commits mailing list