With a constexpr-specified function foo_constexpr I have code such as shown below:
const auto x = foo_constexpr(y); static_assert(x==0); Under which circumstances could the code then fail to compile, when the declaration of x is changed to constexpr? (After all, x must already be a constant expression for use in the static_assert.) That is:
constexpr auto x = foo_constexpr(y); static_assert(x==0);
y? Even if the function isconstexprit can still be called at runtime with a runtime value.foo_constexprcan still be part of a constant expression in that case: as long as it doesn't use the value ofywhen calculating the result.yis and how it's used.