It actually works in trunk gcc/clang: https://godbolt.org/z/oKasW8zqf.

On Fri, May 19, 2023 at 1:29 PM Pavel Vazharov via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
if constexpr ( .... ) { . . . }
else if constexpr ( ... ) { . . . }
else
{
    std::terminate_compilation();
}
I think this proposal covers the above case
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2593r0.html
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals


--
Regards,
Oleksandr Koval.