[libcxx-commits] [libcxx] [libc++] Make list constexpr as part of P3372R3 (PR #129799)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 17 21:00:39 PDT 2025


================
@@ -239,12 +240,24 @@ void test_ctor_under_alloc_with_alloc() {
 #endif
 }
 
-int main(int, char**) {
+TEST_CONSTEXPR_CXX26 bool test() {
   basic_test();
   test_emplacable_concept();
   test_emplacable_concept_with_alloc();
-  test_ctor_under_alloc();
-  test_ctor_under_alloc_with_alloc();
+
+  if (!TEST_IS_CONSTANT_EVALUATED) {
+    test_ctor_under_alloc();
+    test_ctor_under_alloc_with_alloc();
----------------
frederick-vs-ja wrote:

In order to check this in constant evaluation, I think we need to create a controller type that holds the state as member subobjects, and explicitly create and refer to such a controller object. A singleton is unlikely to be usable in constexpr tests.

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


More information about the libcxx-commits mailing list