From: Daniel Arndt Date: Thu, 1 Feb 2024 14:35:11 +0000 (-0500) Subject: Require support for attribute [[assume]] for C++23 support X-Git-Tag: relicensing~83^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=069a7d8b6730e6216d4c82cc49806f9e58104481;p=dealii.git Require support for attribute [[assume]] for C++23 support --- 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.")