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

ChangeLog
lib/verify.h

index 0a21f33a293f902735ccbe4bef7f767b2b8671f2..bf5cf676091584870f518d346d9fe30a0fa9750d 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-12  Bruno Haible  <bruno@clisp.org>
 
        supersede: Avoid a failure when writing to /dev/null in Solaris zones.
index 86bfe8d3092ddc3857a070e256b19a86dd457db4..7555b879e82a86faf6d0b1809071d5a0c675bbd4 100644 (file)
@@ -223,7 +223,7 @@ template <int w>
 #  define _Static_assert(...) \
      _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
 # endif
-# if __cpp_static_assert < 201411 && !defined static_assert
+# if __cpp_static_assert < 201411 && __GNUG__ < 6 && !defined static_assert
 #  define static_assert _Static_assert /* C11 requires this #define.  */
 # endif
 #endif