This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Debug assertion and constexpr


On 27/07/15 21:16 +0200, François Dumont wrote:
Hello

   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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]