No, I'm saying static_assert in non-instantiated templates would not trigger.
template<class T>
class foo;
template<>
class foo<int> {
static_assert(false, "bad");
};
template<>
class foo<float> {};
template<class T>
foo<T> foo_fn(T v) {
if constexpr (std::is_same<T, int>::value) {
return foo<int>{};
}
else if constexpr (std::is_same<T, float>::value) {
return foo<float>{};
}
else {
return foo<T>{};
}
}
foo_fn(1.0); // <-- does not trigger static assert
foo_fn(1); // <-- triggers static assert
This is consistent with the wording of the proposal.