libstdc++: Do not define constexpr assertions for C++11
authorJonathan Wakely <jwakely@redhat.com>
Tue, 15 Dec 2020 15:39:58 +0000 (15:39 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 15 Dec 2020 15:39:58 +0000 (15:39 +0000)
There's no point even checking is_constant_evaluated() in C++11 mode,
because the 'if' statement used for the assertion wouldn't be valid in a
C++11 constexpr function anyway.

libstdc++-v3/ChangeLog:

* include/bits/c++config (__glibcxx_assert_1): Define as empty
for C++11.

libstdc++-v3/include/bits/c++config

index 27302ed..155d0f4 100644 (file)
@@ -684,7 +684,7 @@ namespace std
 
 #undef _GLIBCXX_HAS_BUILTIN
 
-#if _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED
+#if _GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED && __cplusplus >= 201402L
 # define __glibcxx_assert_1(_Condition)                \
     if (__builtin_is_constant_evaluated())     \
      {                                         \