<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/92204>92204</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-cl] NTTP on template functions returning `auto` are mismangled by clang-cl
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-cl
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
MaxEW707
</td>
</tr>
</table>
<pre>
https://godbolt.org/z/WPPraqE1E
```
template <auto a>
auto AutoFunc() {
return a;
}
template <class T, T a>
auto FuncT() {
return a;
}
template<class T, T a>
struct Foo
{
Foo() {}
};
int main()
{
// Clang : ??$FuncT@H$0A@@@YA?A?<auto>@@XZ
// MSVC 1929: ??$FuncT@H$0A@@@YA?A_PXZ
// MSVC 1916: ??$FuncT@H$0A@@@YAHXZ
FuncT<int, 0>();
// Clang : ??$AutoFunc@$0A@@@YA?A?<auto>@@XZ
// MSVC 1929: ??$AutoFunc@$MH0A@@@YA?A_PXZ
// MSVC 1916: ??$AutoFunc@$0A@@@YAHXZ
AutoFunc<0>();
// Clang : ??0?$Foo@H$0A@@@QEAA@XZ
// MSVC 1929: ??0?$Foo@H$0A@@@QEAA@XZ
// MSVC 1916: ??0?$Foo@H$0A@@@QEAA@XZ
Foo<int, 0> _f;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslF9vmzwUxj_N4cZqZI75Ey64oCSoN32VV4vWbTeVAZd4MrjDZlr36ScDJWnXTlk7ySKyffw75zx2Hm6MbDohUggvIdx4fLAH3afX_Mf2JqaxV-r6IT1Ye2-AZYAFYNHoutTKrnTfABY_AYub3a7n37b-FugGaDZ_IzqPcWpFe6-4FQRYzgerCQc2x4_TbLC6GLoKcA2YEIgvp01CemGHvnPx8xLEm9NEp-RKcWPIHjAn--cZHH3_dvzrdGP7obKk0PoRsMDJuHrMuaDjzTHf-JWdJS2X3RS8gAghM2sSn-SKd40DA8sIsMINDKbeAnoFGNAMAjqNzxmwIhujRtFdyePGpy_HCmfw9YePOfETTM4H3-5e5_jReZyrBTGFsFx21ilMXbGTGE-VOsn1shjLUwrov5bjKfr66j2S_KHMoyhLEMvfKAidL0Dr3-X_f5tlZ7f_LtBp738JcnFPXgW5vXvhz_poN16dsjphCfdE6sd-GLMkjBPvkNZMcFz7Yc3qioUBi6N1GSUCGaM0CWnkyRQpBjT0Q4p-wtarNa9pJeLwTgQs4OhuSrRcqpVS31vnf540ZhBpgkgDT_FSKDMaKWLlLuKiUoDobLVP3ZGLcmgMBFRJY80RYqVVowEvh8IN-W-_3xHdkcXd7oauslJ3ZnYs2TUEIjq-44gS3gvSStPyrlGiJuUDeaR5Q6-eW7i0h6FcVboFLFwd88_Ffa-_isoCFmNnBrAYm_sVAAD__3zQlAo">