]> gcc.gnu.org Git - gcc.git/commitdiff
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 27302ed392eb163954c5a2d367831dbcb0ead3c3..155d0f46b165cb9d49f547d81392ac85ead32300 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())     \
      {                                         \
This page took 0.063016 seconds and 5 git commands to generate.