<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61382>61382</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [16 regression] `__PRETTY_FUNCTION__` doesn't normalize the names of template arguments of explicitly specialized templates
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          adalisk-emikhaylov
      </td>
    </tr>
</table>

<pre>
    Consider this example:
```cpp
#include <iostream>

template <typename T>
void PrintType()
{
 std::cout << __PRETTY_FUNCTION__ << '\n';
}

namespace NS
{
 struct A {};

    template <typename T> struct B {};
    template <> struct B<A> {};
}

int main()
{
 PrintType<NS::B<NS::A>>();
}
```
In Clang 15, this prints `void PrintType() [T = NS::B<NS::A>]` as expected. But Clang trunk prints `void PrintType() [T = NS::B<A>]`. Note `A` instead of `NS::A`.

If you remove the explicit specialization, it doesn't happen. In fact, it reproduces exactly what was written in the specialization. `template <> struct B<::NS::A> {};` makes it print `::NS::A`, and so on.

At work we use `__PRETTY_FUNCTION__` to determine type names at compile-time, and this introduces unwanted differences between compiler versions.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVM2O4jgXfRqzuaoosUlSLLLgp5Fqw9f6mlnMCpn4Bjw4dmTfwDBPP3ICBVVd3YuRovz4-p5zfHJsGYI-WMSK5QuWryayp6PzlVTS6HB6wVafjvJq3Hmyd-paLZ0NWqEHOuoA-LdsO4NMzFm6YumcFel41V13G-FC29r0CoGJpXaBPMqWiW-38nAnbDsjaZhC1w6tbBG275POTiv47rWl7bVDxl8Zn93ay8X4AoFUVCHmtesp4jCxhN3u-_-_bbd_7tZ_bJbbt_9tdrt7ifGS5UsbH2JxB1s9i4oiQidrhM2Pn9l8XxPMIQ6VqwfEWAaAXy7p3rv43Pu563kuE8t5_P5M91GxtgSt1PZr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