From: Bruno Haible Date: Wed, 14 Sep 2022 01:04:10 +0000 (+0200) Subject: verify: Avoid syntax error due to static_assert with GNU C++ 6.x. X-Git-Tag: v1.0~2025 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=0e59ffd2e436b4e2b1f5b55b60ca7b6455c2c4b7;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 67be594ec9..81183fa619 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-09-13 Bruno Haible + + 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 stdalign: prefer to not include diff --git a/lib/verify.h b/lib/verify.h index 0066d211b2..154a5b76bf 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -227,7 +227,8 @@ template _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