You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<source>:14:6: error: definition with same mangled name '_Z3funIcEvT_' as another definition<source>:8:6: note: previous definition is hereExpected: Prints foo<char>(), or at least a less cryptic error
Fixed in 4b163e3. Contrary to the suggestion at the start of this issue, the program prints
foo<std::integral>()
because the fun(char) explicit specialization specializes the primary template, not the constrained template<integral> overload, because the latter is not yet declared. And overload resolution picks the template<integral> version because it's more constrained.
Compile with
-std=c++20
.Result:
https://godbolt.org/z/axvdbK1Eh
GCC and MSVC have similar bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107151
https://developercommunity.visualstudio.com/t/Template-explicit-specializationconcept/10012835
The text was updated successfully, but these errors were encountered: