g++ happily accepts the following code, whereas clang nor msvc are able to match out of line definitions.
Any idea why ?
template <bool B>
struct test
{
test() requires (B);
test() requires(!B);
};
template <>
test<true>::test()
{}
template <>
test<false>::test()
{}
int main()
{
test<false> a;
test<true> b;
return 0;
}
Clang:
error: out-of-line definition of '
test' does not match any declaration in 'test<true>'
Msvc:
error C2244: '
test<true>::test': unable to match function definition to an existing declaration