This is the mail archive of the
mailing list for the GCC project.
Re: Debug assertion and constexpr
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: François Dumont <frs dot dumont at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 28 Jul 2015 14:57:11 +0100
- Subject: Re: Debug assertion and constexpr
- Authentication-results: sourceware.org; auth=none
- References: <55B68387 dot 6070304 at gmail dot com>
On 27/07/15 21:16 +0200, François Dumont wrote:
There are at the moment several failures in the libstdc++ testsuite
when run in debug mode (_GLIBCXX_DEBUG). This is so because debug
assertions are not const expressions. Several debug assertions have been
removed because of this issue.
So is there a way to define a function as to be ignored in the
context of a const expression ? If not could we add one ?
No, there is no way without making non-standard front end changes.
I think we should wait and see if
http://cplusplus.github.io/LWG/lwg-active.html#2234 get resolved, then
we can use __builtin_assert() in constexpr functions. It won't give
us the full Debug Mode assertion powers, so no pretty messages
containing formatted information, but we could still assert.