]> Savannah Git Hosting - gnulib.git/commitdiff
verify: Avoid syntax error due to static_assert with GNU C++ 6.x.
authorBruno Haible <bruno@clisp.org>
Wed, 14 Sep 2022 01:04:10 +0000 (03:04 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 14 Sep 2022 01:04:10 +0000 (03:04 +0200)
* lib/verify.h (static_assert): Don't define in GNU C++ 6 or newer.

ChangeLog
lib/verify.h

index 67be594ec93e8aa7c9c5a9ee29098d71affb8de4..81183fa6192a4ef493eec07b2dc21fdfc106b807 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-09-13  Bruno Haible  <bruno@clisp.org>
+
+       verify: Avoid syntax error due to static_assert with GNU C++ 6.x.
+       * lib/verify.h (static_assert): Don't define in GNU C++ 6 or newer.
+
 2022-09-13  Paul Eggert  <eggert@cs.ucla.edu>
 
        stdalign: prefer to not include <stdalign.h>
index 0066d211b2300cc5d790520e75ca8fc2980ece1d..154a5b76bfb447f71e3d94febca3a80cdd582f78 100644 (file)
@@ -227,7 +227,8 @@ template <int w>
      _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
 # endif
 # if (!defined static_assert \
-      && __STDC_VERSION__ < 202311 && __cpp_static_assert < 201411)
+      && __STDC_VERSION__ < 202311 \
+      && __cpp_static_assert < 201411 && __GNUG__ < 6)
 #  define static_assert _Static_assert /* C11 requires this #define.  */
 # endif
 #endif