On Sat, May 8, 2021 at 2:18 PM Jonathan Wakely <cxx@kayari.org> wrote:

I think adding std::unreachable(); after the assertion would work for that purpose.

If I'm reading it correctly, the paper says that unreachable is not allowed in a constant expression (because calling it is UB).  That is a breaking change for calling assert in a constexpr context [assertions.assert].  And even if we fix the one in the standard, how can users write their own?


Don't get me wrong; I'd love to see this become a required warning/error if we can do it.  But the devil is always in the details.
--
 Nevin ":-)" Liber  <mailto:nevin@cplusplusguy.com>  +1-847-691-1404