From 0e59ffd2e436b4e2b1f5b55b60ca7b6455c2c4b7 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 14 Sep 2022 03:04:10 +0200 Subject: [PATCH] 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. --- ChangeLog | 5 +++++ lib/verify.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.5