[PATCH] D91488: Consider reference, pointer, and pointer-to-membber TemplateArguments to be different if they have different types.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 14 18:41:41 PST 2020


rsmith created this revision.
rsmith added a reviewer: rjmccall.
Herald added a subscriber: dexonsmith.
Herald added a project: clang.
rsmith requested review of this revision.

For the Itanium ABI, this implements the mangling rule suggested in
https://github.com/itanium-cxx-abi/cxx-abi/issues/47, namely mangling
such template arguments as being cast to the parameter type in the case
where the template name is unresolved or overloaded. This can cause a
mangling change for rare cases, where

- the template argument declaration is converted from its declared type to the type of the template parameter, and
- the template parameter either has a deduced type, is a parameter of a function tempate (or is somehow a resolved parameter of an unresolved template name).

However, such changes are necessary to avoid mangling collisions. The
ABI changes can be reversed with -fclang-abi-compat=11 or earlier.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91488

Files:
  clang/include/clang/Basic/LangOptions.h
  clang/lib/AST/ItaniumMangle.cpp
  clang/lib/AST/StmtProfile.cpp
  clang/lib/AST/TemplateBase.cpp
  clang/test/CodeGenCXX/clang-abi-compat.cpp
  clang/test/CodeGenCXX/mangle-class-nttp.cpp
  clang/test/CodeGenCXX/mangle-template.cpp
  clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91488.305337.patch
Type: text/x-patch
Size: 33812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201115/b1c52f65/attachment-0001.bin>


More information about the cfe-commits mailing list