https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90302

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |redi at gcc dot gnu.org

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This would be very useful for the C++ library where we currently have
precondition checks that:

- abort at runtime if you compile with -D_GLIBCXX_ASSERTIONS, or
- fail at compile-time if they are constexpr **and** are actually evaluated
during constexpr evaluation

The runtime assertions are good, but not enabled by default, and an earlier
warning at compile time means the problem can be found sooner.

The constexpr errors are good, but don't apply to non-constexpr calls, even if
all the arguments are known during compilation.

It would be nice to be able to also issue warnings for non-constexpr calls,
when compiled without -D_GLIBCXX_ASSERTIONS.

Reply via email to