[libcxx-commits] [libcxx] [libc++] Update `__cpp_lib_flat_set` to `202511L` according to P3567R2 (PR #176297)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 15 18:03:57 PST 2026


https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/176297

The paper was already implemented in LLVM22 in
cd13170aea2db35e04e4842806b14383864d3a97. But the previous patch forgot updating `__cpp_lib_flat_set`.

Fixes #176232.

>From bce559e6c2b58c11648fcd8799556541e18b5000 Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Fri, 16 Jan 2026 10:01:05 +0800
Subject: [PATCH] [libc++] Update `__cpp_lib_flat_set` to `202511L` according
 to P3567R2

The paper was already implemented in LLVM22 in
cd13170aea2db35e04e4842806b14383864d3a97. But the previous patch forgot
updating `__cpp_lib_flat_set`.
---
 libcxx/docs/FeatureTestMacroTable.rst                     | 2 +-
 libcxx/include/version                                    | 4 ++--
 .../flat_set.version.compile.pass.cpp                     | 8 ++++----
 .../version.version.compile.pass.cpp                      | 8 ++++----
 libcxx/utils/generate_feature_test_macro_components.py    | 2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index 32911d0f64449..26084f7a7793a 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -336,7 +336,7 @@ Status
     ---------------------------------------------------------- -----------------
     ``__cpp_lib_flat_map``                                     ``202511L``
     ---------------------------------------------------------- -----------------
-    ``__cpp_lib_flat_set``                                     ``202207L``
+    ``__cpp_lib_flat_set``                                     ``202511L``
     ---------------------------------------------------------- -----------------
     ``__cpp_lib_format_ranges``                                ``202207L``
     ---------------------------------------------------------- -----------------
diff --git a/libcxx/include/version b/libcxx/include/version
index d47f0cb6cd41c..c80e34284f191 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -112,7 +112,7 @@ __cpp_lib_execution                                     201902L <execution>
 __cpp_lib_expected                                      202211L <expected>
 __cpp_lib_filesystem                                    201703L <filesystem>
 __cpp_lib_flat_map                                      202511L <flat_map>
-__cpp_lib_flat_set                                      202207L <flat_set>
+__cpp_lib_flat_set                                      202511L <flat_set>
 __cpp_lib_format                                        202110L <format>
 __cpp_lib_format_path                                   202403L <filesystem>
 __cpp_lib_format_ranges                                 202207L <format>
@@ -498,7 +498,7 @@ __cpp_lib_void_t                                        201411L <type_traits>
 # define __cpp_lib_containers_ranges                    202202L
 # define __cpp_lib_expected                             202211L
 # define __cpp_lib_flat_map                             202511L
-# define __cpp_lib_flat_set                             202207L
+# define __cpp_lib_flat_set                             202511L
 # define __cpp_lib_format_ranges                        202207L
 // # define __cpp_lib_formatters                           202302L
 # define __cpp_lib_forward_like                         202207L
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp
index b29da9fdbe649..725e5107c8997 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/flat_set.version.compile.pass.cpp
@@ -67,8 +67,8 @@
 #  ifndef __cpp_lib_flat_set
 #    error "__cpp_lib_flat_set should be defined in c++23"
 #  endif
-#  if __cpp_lib_flat_set != 202207L
-#    error "__cpp_lib_flat_set should have the value 202207L in c++23"
+#  if __cpp_lib_flat_set != 202511L
+#    error "__cpp_lib_flat_set should have the value 202511L in c++23"
 #  endif
 
 #elif TEST_STD_VER > 23
@@ -83,8 +83,8 @@
 #  ifndef __cpp_lib_flat_set
 #    error "__cpp_lib_flat_set should be defined in c++26"
 #  endif
-#  if __cpp_lib_flat_set != 202207L
-#    error "__cpp_lib_flat_set should have the value 202207L in c++26"
+#  if __cpp_lib_flat_set != 202511L
+#    error "__cpp_lib_flat_set should have the value 202511L in c++26"
 #  endif
 
 #endif // TEST_STD_VER > 23
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
index aacccc0451693..31c3f1898ff83 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
@@ -5088,8 +5088,8 @@
 #  ifndef __cpp_lib_flat_set
 #    error "__cpp_lib_flat_set should be defined in c++23"
 #  endif
-#  if __cpp_lib_flat_set != 202207L
-#    error "__cpp_lib_flat_set should have the value 202207L in c++23"
+#  if __cpp_lib_flat_set != 202511L
+#    error "__cpp_lib_flat_set should have the value 202511L in c++23"
 #  endif
 
 #  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
@@ -6833,8 +6833,8 @@
 #  ifndef __cpp_lib_flat_set
 #    error "__cpp_lib_flat_set should be defined in c++26"
 #  endif
-#  if __cpp_lib_flat_set != 202207L
-#    error "__cpp_lib_flat_set should have the value 202207L in c++26"
+#  if __cpp_lib_flat_set != 202511L
+#    error "__cpp_lib_flat_set should have the value 202511L in c++26"
 #  endif
 
 #  if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index a847042bf47c0..71bddc79ef488 100644
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -562,7 +562,7 @@ def add_version_header(tc):
         },
         {
             "name": "__cpp_lib_flat_set",
-            "values": {"c++23": 202207},
+            "values": {"c++23": 202511},
             "headers": ["flat_set"],
         },
         {



More information about the libcxx-commits mailing list