From 678ea420969786fddd16945be6bcd1c77a4ab550 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 18 Sep 2022 21:14:35 +0200 Subject: [PATCH] verify: Avoid syntax error due to static_assert with MSVC 14. * lib/verify.h (_Static_assert): Pass only the first argument to _GL_VERIFY. --- ChangeLog | 6 ++++++ lib/verify.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf5cf67609..b8facecd31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-09-14 Bruno Haible + + verify: Avoid syntax error due to static_assert with MSVC 14. + * lib/verify.h (_Static_assert): Pass only the first argument to + _GL_VERIFY. + 2022-09-13 Bruno Haible verify: Avoid syntax error due to static_assert with GNU C++ 6.x. diff --git a/lib/verify.h b/lib/verify.h index 7555b879e8..dc99beed60 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -220,8 +220,8 @@ template /* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */ #ifdef _GL_STATIC_ASSERT_H # if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert -# define _Static_assert(...) \ - _GL_VERIFY (__VA_ARGS__, "static assertion failed", -) +# define _Static_assert(R, ...) \ + _GL_VERIFY ((R), "static assertion failed", -) # endif # if __cpp_static_assert < 201411 && __GNUG__ < 6 && !defined static_assert # define static_assert _Static_assert /* C11 requires this #define. */ -- 2.39.5