From 67f7da8b0e7593a871d5dabd7a86c2bd20ffdc15 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 28 Dec 2024 17:40:44 +0100 Subject: [PATCH] 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++. --- ChangeLog | 6 ++++++ lib/verify.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 09d4db94b2..af2a4bf6d3 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 endian: Fix compilation error on NetBSD 7.1. 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 \ -- 2.39.5