Issue 92204
Summary [clang-cl] NTTP on template functions returning `auto` are mismangled by clang-cl
Labels clang-cl
Assignees
Reporter MaxEW707
    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;
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to