[PATCH] Complete _GLIBCXX_DEBUG constexpr compatibility
Jonathan Wakely
jwakely@redhat.com
Fri Dec 11 10:29:23 GMT 2020
On 11/12/20 08:20 +0100, François Dumont via Libstdc++ wrote:
>Hi
>
>I'd like to commit this small fix to complete _GLIBCXX_DEBUG constexpr
>compatibility. There are still 2 macros not using __glibcxx_assert_1.
>
>It fixes the generated diagnostic to have the __failed_assertion
>rather than a message saying that _Error_formatter::_M_error is not
>constexpr.
>
>Â Â Â libstdc++: Fix _GLIBCXX_DEBUG mode constexpr compatibility
>
>Â Â Â The __glibcxx_check_can_[increment|decrement]_range macros are
>using the
>Â Â Â _GLIBCXX_DEBUG_VERIFY_COND_AT macro which is not constexpr
>compliant and will produce nasty
>Â Â Â diagnostics rather than the std::__failed_assertion dedicated to
>constexpr. Replace it with
>Â Â Â correct _GLIBCXX_DEBUG_VERIFY_AT_F.
>
>Â Â Â libstdc++-v3/ChangeLog:
>Â Â Â Â Â Â Â Â Â Â Â * include/debug/macros.h
>(__glibcxx_check_can_increment_range): Replace
>Â Â Â Â Â Â Â Â Â Â Â _GLIBCXX_DEBUG_VERIFY_COND_AT usage with
>_GLIBCXX_DEBUG_VERIFY_AT_F.
>Â Â Â Â Â Â Â Â Â Â Â (__glibcxx_check_can_decrement_range): Likewise.
>Â Â Â Â Â Â Â Â Â Â Â * testsuite/25_algorithms/copy_backward/constexpr.cc
>(test03): New.
>Â Â Â Â Â Â Â Â Â Â Â * testsuite/25_algorithms/copy/debug/constexpr_neg.cc: New
>test.
>Â Â Â Â Â Â Â Â Â Â Â *
>testsuite/25_algorithms/copy_backward/debug/constexpr_neg.cc: New
>test.
>Â Â Â Â Â Â Â Â Â Â Â * testsuite/25_algorithms/equal/constexpr_neg.cc: New test.
>Â Â Â Â Â Â Â Â Â Â Â * testsuite/25_algorithms/equal/debug/constexpr_neg.cc:
>New test.
>
>Tested under Linux x86_64 normal and debug modes.
>
>Ok to commit ?
OK, thanks.
Please also test with RUNTESTFLAGS=--target_board=unix/-std=gnu++11
just to be sure, but I don't think these macros are used in any code
that is constexpr in C++11.
More information about the Libstdc++
mailing list