https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96821
Daniil Dudkin <dudkindaniilm2 at yandex dot ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |--- Status|RESOLVED |REOPENED --- Comment #5 from Daniil Dudkin <dudkindaniilm2 at yandex dot ru> --- (In reply to Patrick Palka from comment #4) > GCC's behaviour is correct, I think. Since the concept constant_expression > doesn't use its template parameter, the normal form of foo's associated > constraint is just 'true (with an empty parameter mapping)', so the > satisfaction value of with_value_constant<T> for any T is trivially true and > independent of T. No, I don't think that GCC behaviour is correct. http://eel.is/c++draft/temp.constr#atomic-3 > If substitution results in an invalid type or expression, the constraint is > not satisfied. The substitution with_value_constant<WithNotConstant::value> results in an invalid expression because WithNotConstant::value is not a constant expression, so it cannot be used as a non-type template argument. That means with_value_constant<WithNotConstant::value> should be false regardless how with_value_constant is defined.