[libcxx-commits] [libcxx] [libcxxabi] [libc++] Strictly enforce C++ language requirements. (PR #130501)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 9 11:22:25 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)

<details>
<summary>Changes</summary>

This was disabled for documentation bots. Testing whether that is still required. Compiling the dylib with a language standard before C++23 does not work, so it would be good when this can be enforced by CMake.

---
Full diff: https://github.com/llvm/llvm-project/pull/130501.diff


2 Files Affected:

- (modified) libcxx/CMakeLists.txt (+1-1) 
- (modified) libcxxabi/src/CMakeLists.txt (+2-2) 


``````````diff
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index abe12c2805a7c..d40abaf18dd4a 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -499,7 +499,7 @@ function(cxx_add_basic_build_flags target)
   # Use C++23 for all targets.
   set_target_properties(${target} PROPERTIES
     CXX_STANDARD 23
-    CXX_STANDARD_REQUIRED OFF # TODO: Make this REQUIRED once we don't need to accommodate the LLVM documentation builders using an ancient CMake
+	CXX_STANDARD_REQUIRED ON
     CXX_EXTENSIONS NO)
 
   # When building the dylib, don't warn for unavailable aligned allocation
diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 0a6fc892a4f69..256c87427d746 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -181,7 +181,7 @@ set_target_properties(cxxabi_shared_objects
   PROPERTIES
     CXX_EXTENSIONS OFF
     CXX_STANDARD 23
-    CXX_STANDARD_REQUIRED OFF # TODO: Make this REQUIRED once we don't need to accommodate the LLVM documentation builders using an ancient CMake
+	CXX_STANDARD_REQUIRED ON
     COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS}"
     DEFINE_SYMBOL ""
 )
@@ -280,7 +280,7 @@ set_target_properties(cxxabi_static_objects
   PROPERTIES
     CXX_EXTENSIONS OFF
     CXX_STANDARD 23
-    CXX_STANDARD_REQUIRED OFF # TODO: Make this REQUIRED once we don't need to accommodate the LLVM documentation builders using an ancient CMake
+	CXX_STANDARD_REQUIRED ON
     COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS}"
 )
 target_compile_options(cxxabi_static_objects PRIVATE "${LIBCXXABI_ADDITIONAL_COMPILE_FLAGS}")

``````````

</details>


https://github.com/llvm/llvm-project/pull/130501


More information about the libcxx-commits mailing list