https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116552

            Bug ID: 116552
           Summary: [ABI] Incorrect mangling for CTAD placeholder
                    referencing template template parameter
           Product: gcc
           Version: 14.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mizvekov at gmail dot com
  Target Milestone: ---

For a test case like:

```C++
template <template <class> class TemplateTemplateParam>
void create_unique()
  requires (TemplateTemplateParam{0}, true) {}

template <class Fn> struct A {
  constexpr A(Fn) {};
};

template void create_unique<A>();
```
https://compiler-explorer.com/z/9446so8fh

The template parameter name ends up appearing in the mangling for
create_unique:
_Z13create_uniqueI1AEvvQcmtl21TemplateTemplateParamLi0EELb1E(

Normally in these cases we would use the template-prefix production, which
includes a special case for mangling template parameters based on their index.

Following the discussion in
https://github.com/itanium-cxx-abi/cxx-abi/issues/109, it seems like consensus
on the template-prefix production was reached.

Reference to clang PR dealing with this issue:
https://github.com/llvm/llvm-project/pull/106335

Reply via email to