[PATCH] D147655: Implement mangling rules for C++20 concepts and requires-expressions.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 26 10:38:00 PDT 2023


rjmccall added a comment.

In D147655#4650964 <https://reviews.llvm.org/D147655#4650964>, @probinson wrote:

> Hi @rsmith,
>
>> these two different templates would have the same mangling:
>
>   template <typename T, T I> T returnit() {return I;};
>   template <typename T, int I> T returnit() { return I; }
>
> I tried compiling `long foo() { return returnit<long, 4>(); }` with these two templates, and got different manglings. 
> `_Z8returnitIlLl4EET_v` and
> `_Z8returnitIlLi4EET_v`
>
> Am I misunderstanding something about the problem with the old mangling rules?

You need to do `returnit<int, 4>`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147655/new/

https://reviews.llvm.org/D147655



More information about the cfe-commits mailing list