template <class A>
struct Foo {
template <class Bar>
constexpr auto a_method();
};
template <class A>
template <class Bar>
constexpr auto Foo<A>::a_method() {
return 42;
}
template <>
template <class Bar>
constexpr auto Foo<void>::a_method() {
return 42;
}
GCC can compile this.
But Clang cannot. The errors output:
<source>:15:27: error: conflicting types for 'a_method'
constexpr auto Foo<void>::a_method() {
^
<source>:4:18: note: previous declaration is here
constexpr auto a_method();
^
1 error generated.
Compiler returned: 1