https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96182
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Keywords|accepts-invalid |diagnostic
Last reconfirmed| |2020-07-13
Severity|normal |enhancement
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
[decl.constexpr] p6 in the C++ standard says:
"if no argument values exist such that an invocation of the function or
constructor could be an evaluated subexpression of a core constant expression
[...] the program is ill-formed, no diagnostic required."
So the foo() function is ill-formed, but implementations are not required to
diagnose it unless the function is actually evaluated.
So this is not accepts-invalid, but I'll confirm it as a request for a
diagnostic enhancement.