From: Bruno Haible Date: Sat, 28 Dec 2024 16:40:44 +0000 (+0100) Subject: assert-h, verify: Make static_assert work in C++ mode on FreeBSD 11. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=e6f85072a78f3107000b5e123d54c90635664683;p=gnulib.git assert-h, verify: Make static_assert work in C++ mode on FreeBSD 11. * lib/verify.h (static_assert): Override when using old versions of clang++. --- diff --git a/ChangeLog b/ChangeLog index bdf29d5e48..dc27be4ab8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-12-28 Bruno Haible + + assert-h, verify: Make static_assert work in C++ mode on FreeBSD 11. + * lib/verify.h (static_assert): Override when using old versions of + clang++. + 2024-12-28 Bruno Haible wchar: Fix wcrtomb prototype conflict in C++ mode on OpenBSD 6.0. diff --git a/lib/verify.h b/lib/verify.h index 49a73c0508..c4b6d50384 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -255,6 +255,11 @@ template # endif # endif /* Define static_assert if needed. */ +# if defined __cplusplus && defined __clang__ && __clang_major__ < 9 +/* clang++ before commit 5c739665a8721228cf6143fd4ef95870a59f55ae had a + two-arguments static_assert but not the one-argument static_assert. */ +# undef static_assert +# endif # if (!defined static_assert \ && __STDC_VERSION__ < 202311 \ && (!defined __cplusplus \