<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/134156>134156</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[CodeView] Simple types in template parameters aren't renamed
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Nerixyz
</td>
</tr>
</table>
<pre>
`clang-cl` and `cl` produce different names for simple types used in template arguments. They produce the same simple type names for the member. I'm not sure if this is a Clang or LLVM issue. I'm guessing this is an issue with LLVM, because it's the one turning `long long` into `__int64` ([`DebugInfo/CodeView/TypeIndex.cpp`](https://github.com/llvm/llvm-project/blob/564e04b703dc5df062f862e32c00bf1a1716f96f/llvm/lib/DebugInfo/CodeView/TypeIndex.cpp#L26-L91)).
**Reproduction**
```cpp
// main.cpp
template <typename T> class Foo {
T bar;
};
template class Foo<long long>;
```
Compile with `clang-cl` and `cl`:
```console
> clang-cl main.cpp /Zi -o clang-output
> cl main.cpp /Zi -o msvc-output
```
Check names in PDB:
```console
> llvm-pdbutil pretty clang-output.pdb -classes --include-types=Foo
Summary for F:\Dev\cpp-test\clang-output.pdb
Size: 7008256 bytes
Guid: {F75AB9BC-7C91-462D-866C-06174965CC9F}
Age: 1
Attributes: HasPrivateSymbols
---TYPES---
Classes: (Showing 911 items)
class Foo<long long> [sizeof = 8] {
data +0x00 [sizeof=8] __int64 bar
}
> llvm-pdbutil pretty msvc-output.pdb -classes --include-types=Foo
Summary for F:\Dev\cpp-test\msvc-output.pdb
Size: 7008256 bytes
Guid: {AA4A4274-D8EE-49E0-9121-A2A5FF45EE17}
Age: 1
Attributes: HasPrivateSymbols
---TYPES---
Classes: (Showing 911 items)
class Foo<__int64> [sizeof = 8] {
data +0x00 [sizeof=8] __int64 bar
}
```
Notice the different names for the type of the class - `Foo<long long>` (clang-cl) and `Foo<__int64>` (cl).
The relevant part of the generated IR:
```llvm
!18 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "Foo<long long>", file: !12, line: 1, size: 64, flags: DIFlagTypePassByValue, elements: !19, templateParams: !22, identifier: ".?AV?$Foo@_J@@")
!19 = !{!20}
!20 = !DIDerivedType(tag: DW_TAG_member, name: "bar", scope: !18, file: !12, line: 2, baseType: !21, size: 64)
!21 = !DIBasicType(name: "long long", size: 64, encoding: DW_ATE_signed)
!22 = !{!23}
!23 = !DITemplateTypeParameter(name: "T", type: !21)
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0Vttu4zYTfhr6ZiCDpM4XvpAla__8SBfBxkjR3gSUNLLZ6gSRStb79AUp-bBpGmyBbSDEEjmHb-YbDkcoJQ8d4ob4W-JnKzHpYz9uPuMov56-rYq-Om1IQMtGdAenbEhAQXQV2CXzMYx9NZUIlaxrHLHT0IkWFdT9CEq2Q4OgTwMqmBRWIDvQ2A6N0AhiPEwtdlqtYX_E08WSPiIo0eKt-o1Rs91iW-C4hjvCwxa6XoOaRgRZgz5KBVKBgNQghn6E-_unX0AqNeFZ4TChUrI7XKW7WQBepT5aBcJTKLAUk0KQmvBQWcd9h6CnsTPKJKBN3x3A_DOZkJ3uzeLzs-x04JklwiOT1oBmWEyHu67uCc_TvsInia-E5_vTgHddhV_X5TCQgBI_Izw6aj0o4iaE54TnB6mPU7Eu-5bwvGlezj_OMPZ_YKkJz4umLwjP_cBD6hUhdavSr2oa8DoKOLq8pLSomWAhC-o4qG_sSKP3Q-C4e88D5z5mhMeEx2tCE_Nw83zBmTst-25eMVsBnR-jTZdgoBWyW88rl0Igbmo4NhTDnrg7KBuhFOR9DyTcEpoA7KEQI3HNBwmz-eWifxEnbnplxN0t8mcchCZp3w6yWWj-oKpN8m8j6DvVN2iWZnRW6RILEJ7_LsHpl61-0sOkL9LvyLXqpbwRu0V4xPLPpdplBw_Z9kMscyFUxaRlA8OIWp--A7EeqgIcmyBU4DiyK5upQsceSeJmJmk0eZzaVowne7xy489PM3whfloOg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