Closed
Description
These:
constexpr int f() {}
static_assert(__is_same(decltype([] constexpr -> int {}()), int));
consteval int g() {}
static_assert(__is_same(decltype([] consteval -> int {}()), int));
Should compile in C++23. It probably still should have a warning diagnostic (the -Wreturn-type
"non-void {function|lambda} does not return a value" should be issued for f
and g
at least), but it shouldn't be an error (https://wg21.link/P2448R2#pnum_24)
Currently, these issue the diagnostic error: no return statement in constexpr/consteval function/lambda
Also #63617 does not apply to C++23
See also: #77753