https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119047
Bug ID: 119047
Summary: "partial specialization is not more specialized than"
confused by std::enable_if
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: drahflow at gmx dot de
Target Milestone: ---
GCC 7.0 to 14.2 warn that "partial specialization is not more specialized than"
the primary template on
#include <type_traits>
template<int N, int M, int Z> struct Tmpl {
int f() { return 0; }
};
template<int N,
typename std::enable_if<N % 2 == 0, int>::type M>
struct Tmpl<N, M, 0> {
int f() { return 1; }
};
int main(void) {
return Tmpl<6, 6, 0>().f();
}
even though the specialization is (whether or not actually available after all)
more specialized in Z.
Godbolt: https://godbolt.org/z/GEb7f4Y5M