[clang] [clang] mangle placeholder for deduced type as a template-prefix (PR #106335)

via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 01:04:46 PDT 2024


================
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -std=c++20 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
+
+template <template <class> class S>
+void create_unique()
+  requires (S{0}, true) {}
+
+template <class Fn> struct A {
+  constexpr A(Fn) {};
+};
+
+template void create_unique<A>();
+// CHECK: @_Z13create_uniqueI1AEvvQcmtlT_Li0EELb1E(
----------------
cor3ntin wrote:

There is a difference compared to GCC
https://compiler-explorer.com/z/1EvTrecvh

```
_Z13create_uniqueI1AEvvQcmtl1SLi0EELb1E
 => void create_unique<A>() requires T{0}, true

_Z13create_uniqueI1AEvvQcmtlT_Li0EELb1E
 => void create_unique<A>() requires S{0}, true
```
Which i guess is because of the improper canonicalisation

Given that this changes looks correct we should land it, and because main is crashing, we should backport it.
So, we should remove the changelog entry and instead add a changelog entry to 19x explaining the breaking mangling change.

We probably want to make sure this is on GCC's radar.
How hard would it be to get back the older behavior? If at all possible we might want to consider putting the new mangling under an ABI flag.

@AaronBallman @zygoloid @rjmccall 


https://github.com/llvm/llvm-project/pull/106335


More information about the cfe-commits mailing list