[libcxx-commits] [libcxx] [libc++] LWG 3987 provide iterator.range access from flat_{map, set} (PR #137524)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 4 10:25:57 PDT 2025


================
@@ -0,0 +1,185 @@
+# ===----------------------------------------------------------------------===##
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+#
+# ===----------------------------------------------------------------------===##
+
+# In addition to being available via inclusion of the <iterator> header,
+# the function templates in [iterator.range] are available when any of the following
+# headers are included: <array>, <deque>, <flat_map>, <flat_set>, <forward_list>,
+# <list>, <map>, <regex>, <set>, <span>, <string>, <string_view>, <unordered_map>,
+# <unordered_set>, <vector>.
+
+# RUN: %{python} %s %{libcxx-dir}/utils
+# END.
+
+import sys
+
+sys.path.append(sys.argv[1])
+from libcxx.header_information import (
+    lit_header_restrictions,
+    lit_header_undeprecations,
+    Header,
+)
+
+headers = list(
+    map(
+        Header,
+        [
+            "array",
+            "deque",
+            "flat_map",
+            "flat_set",
+            "forward_list",
+            "list",
+            "map",
+            "regex",
+            "set",
+            "span",
+            "string",
+            "string_view",
+            "unordered_map",
+            "unordered_set",
+            "vector",
+        ],
+    )
+)
+
+for header in headers:
+    print(
+        f"""\
+//--- {header}.pass.cpp
+{lit_header_restrictions.get(header, '')}
+{lit_header_undeprecations.get(header, '')}
+// SUPPORTED: clang-modules-build
+// UNSUPPORTED: c++03
+
+// Some of the functions' return type, reverse_iterator, is not exported from
+// these headers, so we need to include <iterator> explicitly, which defeats
+// the purpose of this test. So disable the test for clang modules.
----------------
ldionne wrote:

I think this comment isn't current anymore.

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


More information about the libcxx-commits mailing list