Issue 58142
Summary error: definition with same mangled name when specializing a concepted template
Labels new issue
Assignees
Reporter Alcaro
    ```c++
#include <cstdio>
#include <concepts>

template <typename T>
void fun(T);

template <>
void fun(char c)
{
    std::puts("foo<char>()");
}

template <std::integral I>
void fun(I i)
{
    std::puts("foo<std::integral>()");
}

int main()
{
    fun<char>(' ');
}
```
Compile with -std=c++20.

Result:
\<source\>:14:6: error: definition with same mangled name '_Z3funIcEvT_' as another definition
\<source\>:8:6: note: previous definition is here

Expected: Prints foo\<char\>(), or at least a less cryptic error

https://godbolt.org/z/axvdbK1Eh

GCC and MSVC have similar bugs:
(will edit in ten seconds)
https://developercommunity.visualstudio.com/t/Template-explicit-specializationconcept/10012835
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to