[libcxx-commits] [libcxx] [libcxx] Put `std::monostate` in `<utility>` (PR #128373)
Amr Hesham via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Feb 23 06:54:30 PST 2025
https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/128373
>From 99cfe6a9d20a5f4233d1df590dd64e34f884eb9b Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Sat, 22 Feb 2025 23:13:20 +0100
Subject: [PATCH 1/9] [libcxx] Put `std::monostate` in `<utility>`
---
libcxx/docs/ReleaseNotes/21.rst | 1 +
libcxx/docs/Status/Cxx2cPapers.csv | 2 +-
libcxx/include/__cxx03/__utility/monostate.h | 65 ++++++++++++++++++
libcxx/include/__utility/monostate.h | 66 +++++++++++++++++++
.../utility.monostate.relpos/relops.pass.cpp | 47 +++++++++++++
.../utility.monostate/monostate.pass.cpp | 31 +++++++++
6 files changed, 211 insertions(+), 1 deletion(-)
create mode 100644 libcxx/include/__cxx03/__utility/monostate.h
create mode 100644 libcxx/include/__utility/monostate.h
create mode 100644 libcxx/test/std/utilities/utility/utility.monostate.relpos/relops.pass.cpp
create mode 100644 libcxx/test/std/utilities/utility/utility.monostate/monostate.pass.cpp
diff --git a/libcxx/docs/ReleaseNotes/21.rst b/libcxx/docs/ReleaseNotes/21.rst
index 30c6cc5eaf0c2..d1935c8af02e0 100644
--- a/libcxx/docs/ReleaseNotes/21.rst
+++ b/libcxx/docs/ReleaseNotes/21.rst
@@ -40,6 +40,7 @@ Implemented Papers
- N4258: Cleaning-up noexcept in the Library (`Github <https://github.com/llvm/llvm-project/issues/99937>`__)
- P1361R2: Integration of chrono with text formatting (`Github <https://github.com/llvm/llvm-project/issues/100014>`__)
+- P0472R3: Put std::monostate in <utility> (`Github <https://github.com/llvm/llvm-project/issues/127874`__)
Improvements and New Features
-----------------------------
diff --git a/libcxx/docs/Status/Cxx2cPapers.csv b/libcxx/docs/Status/Cxx2cPapers.csv
index 1436db6cf2b45..a47cc193382da 100644
--- a/libcxx/docs/Status/Cxx2cPapers.csv
+++ b/libcxx/docs/Status/Cxx2cPapers.csv
@@ -102,7 +102,7 @@
"`P3475R2 <https://wg21.link/P3475R2>`__","Defang and deprecate ``memory_order::consume``","2025-02 (Hagenberg)","","",""
"`P2786R13 <https://wg21.link/P2786R13>`__","Trivial Relocatability For C++26","2025-02 (Hagenberg)","","",""
"`P3137R3 <https://wg21.link/P3137R3>`__","``views::to_input``","2025-02 (Hagenberg)","","",""
-"`P0472R3 <https://wg21.link/P0472R3>`__","Put ``std::monostate`` in ``<utility>``","2025-02 (Hagenberg)","","",""
+"`P0472R3 <https://wg21.link/P0472R3>`__","Put ``std::monostate`` in ``<utility>``","2025-02 (Hagenberg)","|Complete|","21",""
"`P3349R1 <https://wg21.link/P3349R1>`__","Converting contiguous iterators to pointers","2025-02 (Hagenberg)","","",""
"`P3372R3 <https://wg21.link/P3372R3>`__","constexpr containers and adaptors","2025-02 (Hagenberg)","","",""
"`P3378R2 <https://wg21.link/P3378R2>`__","constexpr exception types","2025-02 (Hagenberg)","","",""
diff --git a/libcxx/include/__cxx03/__utility/monostate.h b/libcxx/include/__cxx03/__utility/monostate.h
new file mode 100644
index 0000000000000..486a18bfa54ca
--- /dev/null
+++ b/libcxx/include/__cxx03/__utility/monostate.h
@@ -0,0 +1,65 @@
+
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___CXX03___UTILITY_MONOSTATE_H
+#define _LIBCPP___CXX03___UTILITY_MONOSTATE_H
+
+#include <__cxx03/__compare/ordering.h>
+#include <__cxx03/__config>
+#include <__cxx03/__functional/hash.h>
+#include <__cxx03/cstddef>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 17
+
+struct _LIBCPP_TEMPLATE_VIS monostate {};
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(monostate, monostate) noexcept { return true; }
+
+# if _LIBCPP_STD_VER >= 20
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(monostate, monostate) noexcept {
+ return strong_ordering::equal;
+}
+
+# else // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator!=(monostate, monostate) noexcept { return false; }
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<(monostate, monostate) noexcept { return false; }
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>(monostate, monostate) noexcept { return false; }
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<=(monostate, monostate) noexcept { return true; }
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>=(monostate, monostate) noexcept { return true; }
+
+# endif // _LIBCPP_STD_VER >= 20
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
+ using argument_type = monostate;
+ using result_type = size_t;
+
+ inline _LIBCPP_HIDE_FROM_ABI result_type operator()(const argument_type&) const _NOEXCEPT {
+ return 66740831; // return a fundamentally attractive random value.
+ }
+};
+
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___CXX03___UTILITY_MONOSTATE_H
diff --git a/libcxx/include/__utility/monostate.h b/libcxx/include/__utility/monostate.h
new file mode 100644
index 0000000000000..3a2a659228e1c
--- /dev/null
+++ b/libcxx/include/__utility/monostate.h
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___UTILITY_MONOSTATE_H
+#define _LIBCPP___UTILITY_MONOSTATE_H
+
+#include <__compare/ordering.h>
+#include <__configUTILITY>
+#include <__cstddef/size_t.h>
+#include <__functional/hash.h>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 17
+
+struct _LIBCPP_TEMPLATE_VIS monostate {};
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(monostate, monostate) noexcept { return true; }
+
+# if _LIBCPP_STD_VER >= 20
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(monostate, monostate) noexcept {
+ return strong_ordering::equal;
+}
+
+# else // _LIBCPP_STD_VER >= 20
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator!=(monostate, monostate) noexcept { return false; }
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<(monostate, monostate) noexcept { return false; }
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>(monostate, monostate) noexcept { return false; }
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<=(monostate, monostate) noexcept { return true; }
+
+_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>=(monostate, monostate) noexcept { return true; }
+
+# endif // _LIBCPP_STD_VER >= 20
+
+template <>
+struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
+# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
+ using argument_type _LIBCPP_DEPRECATED_IN_CXX17 = monostate;
+ using result_type _LIBCPP_DEPRECATED_IN_CXX17 = size_t;
+# endif
+
+ inline _LIBCPP_HIDE_FROM_ABI size_t operator()(const monostate&) const noexcept {
+ return 66740831; // return a fundamentally attractive random value.
+ }
+};
+
+#endif // _LIBCPP_STD_VER >= 17
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP___UTILITY_MONOSTATE_H
diff --git a/libcxx/test/std/utilities/utility/utility.monostate.relpos/relops.pass.cpp b/libcxx/test/std/utilities/utility/utility.monostate.relpos/relops.pass.cpp
new file mode 100644
index 0000000000000..f29d89acdc739
--- /dev/null
+++ b/libcxx/test/std/utilities/utility/utility.monostate.relpos/relops.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
+
+// <utility>
+
+// constexpr bool operator<(monostate, monostate) noexcept { return false; }
+// constexpr bool operator>(monostate, monostate) noexcept { return false; }
+// constexpr bool operator<=(monostate, monostate) noexcept { return true; }
+// constexpr bool operator>=(monostate, monostate) noexcept { return true; }
+// constexpr bool operator==(monostate, monostate) noexcept { return true; }
+// constexpr bool operator!=(monostate, monostate) noexcept { return false; }
+// constexpr strong_ordering operator<=>(monostate, monostate) noexcept { return strong_ordering::equal; } // since C++20
+
+#include <cassert>
+#include <utility>
+
+#include "test_comparisons.h"
+#include "test_macros.h"
+
+constexpr bool test() {
+ using M = std::monostate;
+ constexpr M m1{};
+ constexpr M m2{};
+ assert(testComparisons(m1, m2, /*isEqual*/ true, /*isLess*/ false));
+ AssertComparisonsAreNoexcept<M>();
+
+#if TEST_STD_VER > 17
+ assert(testOrder(m1, m2, std::strong_ordering::equal));
+ AssertOrderAreNoexcept<M>();
+#endif // TEST_STD_VER > 17
+
+ return true;
+}
+
+int main(int, char**) {
+ test();
+ static_assert(test());
+
+ return 0;
+}
diff --git a/libcxx/test/std/utilities/utility/utility.monostate/monostate.pass.cpp b/libcxx/test/std/utilities/utility/utility.monostate/monostate.pass.cpp
new file mode 100644
index 0000000000000..c78ce5a5c2f18
--- /dev/null
+++ b/libcxx/test/std/utilities/utility/utility.monostate/monostate.pass.cpp
@@ -0,0 +1,31 @@
+
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
+
+// <utility>
+
+// struct monostate {};
+
+#include <type_traits>
+#include <utility>
+
+#include "test_macros.h"
+
+int main(int, char**) {
+ using M = std::monostate;
+ static_assert(std::is_trivially_default_constructible<M>::value, "");
+ static_assert(std::is_trivially_copy_constructible<M>::value, "");
+ static_assert(std::is_trivially_copy_assignable<M>::value, "");
+ static_assert(std::is_trivially_destructible<M>::value, "");
+ constexpr M m{};
+ ((void)m);
+
+ return 0;
+}
>From bf0ec2016770ce0adb0339521c99db2529061970 Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Sat, 22 Feb 2025 23:52:04 +0100
Subject: [PATCH 2/9] Add utility/monostate.h to cmakelist
---
libcxx/include/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 214c9b1926fb2..9964e1b795ff3 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -911,6 +911,7 @@ set(files
__utility/swap.h
__utility/to_underlying.h
__utility/unreachable.h
+ __utility/monostate.h
__variant/monostate.h
__vector/comparison.h
__vector/container_traits.h
@@ -1938,6 +1939,7 @@ set(files
__cxx03/__utility/swap.h
__cxx03/__utility/to_underlying.h
__cxx03/__utility/unreachable.h
+ __cxx03/__utility/monostate.h
__cxx03/__variant/monostate.h
__cxx03/__verbose_abort
__cxx03/algorithm
>From 9c495564e362eb23111da5bf51206194b7835982 Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Sat, 22 Feb 2025 23:55:42 +0100
Subject: [PATCH 3/9] Fix hyperlink in release note
---
libcxx/docs/ReleaseNotes/21.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/docs/ReleaseNotes/21.rst b/libcxx/docs/ReleaseNotes/21.rst
index d1935c8af02e0..019af3bbed8e2 100644
--- a/libcxx/docs/ReleaseNotes/21.rst
+++ b/libcxx/docs/ReleaseNotes/21.rst
@@ -40,7 +40,7 @@ Implemented Papers
- N4258: Cleaning-up noexcept in the Library (`Github <https://github.com/llvm/llvm-project/issues/99937>`__)
- P1361R2: Integration of chrono with text formatting (`Github <https://github.com/llvm/llvm-project/issues/100014>`__)
-- P0472R3: Put std::monostate in <utility> (`Github <https://github.com/llvm/llvm-project/issues/127874`__)
+- P0472R3: Put std::monostate in <utility> (`Github <https://github.com/llvm/llvm-project/issues/127874>`__)
Improvements and New Features
-----------------------------
>From 11f26e616eb6ba27310efab6a9a14663ee2952a4 Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Sun, 23 Feb 2025 13:40:01 +0100
Subject: [PATCH 4/9] Replace doublicate monostate by include it in utility
---
libcxx/include/__cxx03/__utility/monostate.h | 65 -------------------
libcxx/include/__utility/monostate.h | 66 --------------------
libcxx/include/utility | 4 ++
3 files changed, 4 insertions(+), 131 deletions(-)
delete mode 100644 libcxx/include/__cxx03/__utility/monostate.h
delete mode 100644 libcxx/include/__utility/monostate.h
diff --git a/libcxx/include/__cxx03/__utility/monostate.h b/libcxx/include/__cxx03/__utility/monostate.h
deleted file mode 100644
index 486a18bfa54ca..0000000000000
--- a/libcxx/include/__cxx03/__utility/monostate.h
+++ /dev/null
@@ -1,65 +0,0 @@
-
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___CXX03___UTILITY_MONOSTATE_H
-#define _LIBCPP___CXX03___UTILITY_MONOSTATE_H
-
-#include <__cxx03/__compare/ordering.h>
-#include <__cxx03/__config>
-#include <__cxx03/__functional/hash.h>
-#include <__cxx03/cstddef>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#if _LIBCPP_STD_VER >= 17
-
-struct _LIBCPP_TEMPLATE_VIS monostate {};
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(monostate, monostate) noexcept { return true; }
-
-# if _LIBCPP_STD_VER >= 20
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(monostate, monostate) noexcept {
- return strong_ordering::equal;
-}
-
-# else // _LIBCPP_STD_VER >= 20
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator!=(monostate, monostate) noexcept { return false; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<(monostate, monostate) noexcept { return false; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>(monostate, monostate) noexcept { return false; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<=(monostate, monostate) noexcept { return true; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>=(monostate, monostate) noexcept { return true; }
-
-# endif // _LIBCPP_STD_VER >= 20
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
- using argument_type = monostate;
- using result_type = size_t;
-
- inline _LIBCPP_HIDE_FROM_ABI result_type operator()(const argument_type&) const _NOEXCEPT {
- return 66740831; // return a fundamentally attractive random value.
- }
-};
-
-#endif // _LIBCPP_STD_VER >= 17
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___CXX03___UTILITY_MONOSTATE_H
diff --git a/libcxx/include/__utility/monostate.h b/libcxx/include/__utility/monostate.h
deleted file mode 100644
index 3a2a659228e1c..0000000000000
--- a/libcxx/include/__utility/monostate.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP___UTILITY_MONOSTATE_H
-#define _LIBCPP___UTILITY_MONOSTATE_H
-
-#include <__compare/ordering.h>
-#include <__configUTILITY>
-#include <__cstddef/size_t.h>
-#include <__functional/hash.h>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#if _LIBCPP_STD_VER >= 17
-
-struct _LIBCPP_TEMPLATE_VIS monostate {};
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator==(monostate, monostate) noexcept { return true; }
-
-# if _LIBCPP_STD_VER >= 20
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr strong_ordering operator<=>(monostate, monostate) noexcept {
- return strong_ordering::equal;
-}
-
-# else // _LIBCPP_STD_VER >= 20
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator!=(monostate, monostate) noexcept { return false; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<(monostate, monostate) noexcept { return false; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>(monostate, monostate) noexcept { return false; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator<=(monostate, monostate) noexcept { return true; }
-
-_LIBCPP_HIDE_FROM_ABI inline constexpr bool operator>=(monostate, monostate) noexcept { return true; }
-
-# endif // _LIBCPP_STD_VER >= 20
-
-template <>
-struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
-# if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)
- using argument_type _LIBCPP_DEPRECATED_IN_CXX17 = monostate;
- using result_type _LIBCPP_DEPRECATED_IN_CXX17 = size_t;
-# endif
-
- inline _LIBCPP_HIDE_FROM_ABI size_t operator()(const monostate&) const noexcept {
- return 66740831; // return a fundamentally attractive random value.
- }
-};
-
-#endif // _LIBCPP_STD_VER >= 17
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___UTILITY_MONOSTATE_H
diff --git a/libcxx/include/utility b/libcxx/include/utility
index fb8a6f81350be..4e0dde8cfb16f 100644
--- a/libcxx/include/utility
+++ b/libcxx/include/utility
@@ -279,6 +279,10 @@ template <class T>
# include <__utility/unreachable.h>
# endif
+# if _LIBCPP_STD_VER >= 26
+# include <__variant/monostate.h>
+# endif
+
# include <version>
// standard-mandated includes
>From b1d710f156ad126e9e3fc47414bc5ac6c2e086d0 Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Sun, 23 Feb 2025 13:49:49 +0100
Subject: [PATCH 5/9] Remove building files
---
libcxx/include/CMakeLists.txt | 2 --
1 file changed, 2 deletions(-)
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 9964e1b795ff3..214c9b1926fb2 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -911,7 +911,6 @@ set(files
__utility/swap.h
__utility/to_underlying.h
__utility/unreachable.h
- __utility/monostate.h
__variant/monostate.h
__vector/comparison.h
__vector/container_traits.h
@@ -1939,7 +1938,6 @@ set(files
__cxx03/__utility/swap.h
__cxx03/__utility/to_underlying.h
__cxx03/__utility/unreachable.h
- __cxx03/__utility/monostate.h
__cxx03/__variant/monostate.h
__cxx03/__verbose_abort
__cxx03/algorithm
>From 57c41d08f27ee5b87872c5ddf371cdc55447a05f Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Sun, 23 Feb 2025 13:54:27 +0100
Subject: [PATCH 6/9] Format the macro endif
---
libcxx/include/utility | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/include/utility b/libcxx/include/utility
index 4e0dde8cfb16f..99dd02906b01e 100644
--- a/libcxx/include/utility
+++ b/libcxx/include/utility
@@ -281,7 +281,7 @@ template <class T>
# if _LIBCPP_STD_VER >= 26
# include <__variant/monostate.h>
-# endif
+# endif
# include <version>
>From 9976293ae009af79d607fbff8b4e1cd02bc8381f Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Sun, 23 Feb 2025 13:59:53 +0100
Subject: [PATCH 7/9] Format the code
---
libcxx/include/utility | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/include/utility b/libcxx/include/utility
index 99dd02906b01e..bc4eaf6a0cd02 100644
--- a/libcxx/include/utility
+++ b/libcxx/include/utility
@@ -279,7 +279,7 @@ template <class T>
# include <__utility/unreachable.h>
# endif
-# if _LIBCPP_STD_VER >= 26
+# if _LIBCPP_STD_VER >= 26
# include <__variant/monostate.h>
# endif
>From 432f9acff1bfd90b426300ed4d6e3f5230c1b27d Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Sun, 23 Feb 2025 15:28:54 +0100
Subject: [PATCH 8/9] Add utility cstring to cxx26.csv
---
libcxx/test/libcxx/transitive_includes/cxx26.csv | 1 +
1 file changed, 1 insertion(+)
diff --git a/libcxx/test/libcxx/transitive_includes/cxx26.csv b/libcxx/test/libcxx/transitive_includes/cxx26.csv
index 00ab78e61a457..fb80e1e2b059d 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx26.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx26.csv
@@ -1114,6 +1114,7 @@ unordered_set tuple
unordered_set version
utility compare
utility cstdint
+utility cstring
utility initializer_list
utility limits
utility version
>From b373a408f2bafb9d781d7274c2981d70c6f3a9fb Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Sun, 23 Feb 2025 15:54:06 +0100
Subject: [PATCH 9/9] Add experimental/utility cstring to cxx26.csv
---
libcxx/test/libcxx/transitive_includes/cxx26.csv | 1 +
1 file changed, 1 insertion(+)
diff --git a/libcxx/test/libcxx/transitive_includes/cxx26.csv b/libcxx/test/libcxx/transitive_includes/cxx26.csv
index fb80e1e2b059d..0132144b5375a 100644
--- a/libcxx/test/libcxx/transitive_includes/cxx26.csv
+++ b/libcxx/test/libcxx/transitive_includes/cxx26.csv
@@ -301,6 +301,7 @@ experimental/type_traits type_traits
experimental/type_traits version
experimental/utility compare
experimental/utility cstdint
+experimental/utility cstring
experimental/utility initializer_list
experimental/utility limits
experimental/utility utility
More information about the libcxx-commits
mailing list