Skip to content

[clang-cl] NTTP on template functions returning auto are mismangled by clang-cl #92204

Open
@MaxEW707

Description

@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;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions