From: Matthias Maier Date: Sun, 21 Jan 2024 20:52:05 +0000 (-0600) Subject: base/config.h: enable DEAL_II_CXX23_ASSUME macro X-Git-Tag: relicensing~122^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18968859c032d0feeaff4a573ef0a58aa569b048;p=dealii.git base/config.h: enable DEAL_II_CXX23_ASSUME macro --- diff --git a/include/deal.II/base/config.h.in b/include/deal.II/base/config.h.in index 29be3d6fa9..c9943b3efe 100644 --- a/include/deal.II/base/config.h.in +++ b/include/deal.II/base/config.h.in @@ -183,31 +183,22 @@ * attribute for older standards we rely on compiler intrinsics when * available. */ -#ifdef DEAL_II_EXPERIMENTAL_ASSUME -# error "Test" -# if defined(__clang__) -# define DEAL_II_CXX23_ASSUME(expr) __builtin_assume(static_cast(expr)) -# elif defined(__GNUC__) && !defined(__ICC) && __GNUC__ >= 13 -# define DEAL_II_CXX23_ASSUME(expr) \ - do \ - { \ - _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") \ - [[assume(expr)]]; \ - _Pragma("GCC diagnostic pop") \ - } \ - while (false) -# elif defined(_MSC_VER) || defined(__ICC) -# define DEAL_II_CXX23_ASSUME(expr) __assume(expr); -# else -/* no way with GCC to express this without evaluating 'expr' */ -# define DEAL_II_CXX23_ASSUME(expr) \ - do \ - { \ - } \ - while (false) -# endif +#if defined(__clang__) +# define DEAL_II_CXX23_ASSUME(expr) __builtin_assume(static_cast(expr)) +#elif defined(__GNUC__) && !defined(__ICC) && __GNUC__ >= 13 +# define DEAL_II_CXX23_ASSUME(expr) \ + do \ + { \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") \ + [[assume(expr)]]; \ + _Pragma("GCC diagnostic pop") \ + } \ + while (false) +#elif defined(_MSC_VER) || defined(__ICC) +# define DEAL_II_CXX23_ASSUME(expr) __assume(expr); #else +/* no way with GCC to express this without evaluating 'expr' */ # define DEAL_II_CXX23_ASSUME(expr) \ do \ { \