[all-commits] [llvm/llvm-project] 7b3470: Consider reference, pointer, and pointer-to-member...

Richard Smith via All-commits all-commits at lists.llvm.org
Fri Dec 11 13:37:04 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b3470baf8bab1919e3ad4c18e2b776c1f7be2d5
      https://github.com/llvm/llvm-project/commit/7b3470baf8bab1919e3ad4c18e2b776c1f7be2d5
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-12-11 (Fri, 11 Dec 2020)

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

  Log Message:
  -----------
  Consider reference, pointer, and pointer-to-member TemplateArguments to be different if they have different types.

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 overloadable. 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 or is a parameter of
   a function template.

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

Differential Revision: https://reviews.llvm.org/D91488




More information about the All-commits mailing list