From 069a7d8b6730e6216d4c82cc49806f9e58104481 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 1 Feb 2024 09:35:11 -0500 Subject: [PATCH] Require support for attribute [[assume]] for C++23 support --- cmake/checks/check_01_cxx_features.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/checks/check_01_cxx_features.cmake b/cmake/checks/check_01_cxx_features.cmake index 509f11e2ac..22791a41ee 100644 --- a/cmake/checks/check_01_cxx_features.cmake +++ b/cmake/checks/check_01_cxx_features.cmake @@ -63,6 +63,7 @@ macro(_test_cxx23_support) # Strictly speaking "202100L" indicates support for a preliminary version # of the C++23 standard (which will have "202302L" when finalized). gcc-13 # exports this version number when configured with C++23 support. + add_flags(CMAKE_REQUIRED_FLAGS "-Werror") CHECK_CXX_SOURCE_COMPILES( " #include @@ -75,9 +76,12 @@ macro(_test_cxx23_support) static void operator()() {} }; - int main() {} + int main() { + [[assume(2 > 1)]]; + } " DEAL_II_HAVE_CXX23_FEATURES) + reset_cmake_required() if(DEAL_II_HAVE_CXX23_FEATURES) message(STATUS "C++23 support is enabled.") -- 2.39.5