[libcxx-commits] [libcxx] [libc++] Add tests for LWG3798 and mark it as Complete (PR #210640)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 19 20:39:24 PDT 2026


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

Fixes #105049.

>From 1b0898787716b1892a73d19d8e1d9e69090e9d6b Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Mon, 20 Jul 2026 11:36:05 +0800
Subject: [PATCH] [libc++] Add tests for LWG3798 and mark it as Complete

---
 libcxx/docs/Status/Cxx23Issues.csv                           | 2 +-
 .../ranges/range.adaptors/range.adjacent.transform/helpers.h | 5 +++++
 .../iterator/member_types.compile.pass.cpp                   | 4 ++++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libcxx/docs/Status/Cxx23Issues.csv b/libcxx/docs/Status/Cxx23Issues.csv
index 91c4dc462c0c9..db38715a98973 100644
--- a/libcxx/docs/Status/Cxx23Issues.csv
+++ b/libcxx/docs/Status/Cxx23Issues.csv
@@ -234,7 +234,7 @@
 "`LWG3792 <https://wg21.link/LWG3792>`__","``__cpp_lib_constexpr_algorithms`` should also be defined in ``<utility>``","2022-11 (Kona)","|Complete|","16","`#105046 <https://github.com/llvm/llvm-project/issues/105046>`__",""
 "`LWG3795 <https://wg21.link/LWG3795>`__","Self-move-assignment of ``std::future`` and ``std::shared_future`` have unimplementable postconditions","2022-11 (Kona)","","","`#105047 <https://github.com/llvm/llvm-project/issues/105047>`__",""
 "`LWG3796 <https://wg21.link/LWG3796>`__","``movable-box`` as member should use ``default-initialization`` instead of ``copy-initialization``","2022-11 (Kona)","","","`#105048 <https://github.com/llvm/llvm-project/issues/105048>`__",""
-"`LWG3798 <https://wg21.link/LWG3798>`__","Rvalue reference and ``iterator_category``","2022-11 (Kona)","|Partial|","","`#105049 <https://github.com/llvm/llvm-project/issues/105049>`__","``adjacent_transform_view`` hasn't been done yet since this type isn't implemented yet"
+"`LWG3798 <https://wg21.link/LWG3798>`__","Rvalue reference and ``iterator_category``","2022-11 (Kona)","|Complete|","22","`#105049 <https://github.com/llvm/llvm-project/issues/105049>`__",""
 "`LWG3801 <https://wg21.link/LWG3801>`__","``cartesian_product_view::iterator::distance-from`` ignores the size of last underlying range","2022-11 (Kona)","","","`#105051 <https://github.com/llvm/llvm-project/issues/105051>`__",""
 "`LWG3814 <https://wg21.link/LWG3814>`__","Add freestanding items requested by NB comments","2022-11 (Kona)","","","`#105052 <https://github.com/llvm/llvm-project/issues/105052>`__",""
 "`LWG3816 <https://wg21.link/LWG3816>`__","``flat_map`` and ``flat_multimap`` should impose sequence container requirements","2022-11 (Kona)","","","`#105053 <https://github.com/llvm/llvm-project/issues/105053>`__",""
diff --git a/libcxx/test/std/ranges/range.adaptors/range.adjacent.transform/helpers.h b/libcxx/test/std/ranges/range.adaptors/range.adjacent.transform/helpers.h
index 39f2f856c149b..770cd66d011ea 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.adjacent.transform/helpers.h
+++ b/libcxx/test/std/ranges/range.adaptors/range.adjacent.transform/helpers.h
@@ -13,6 +13,7 @@
 #include <functional>
 #include <numeric>
 #include <tuple>
+#include <utility>
 
 // intentionally not using meta programming for the expected tuple types
 
@@ -35,6 +36,10 @@ struct GetFirst {
   constexpr decltype(auto) operator()(auto&& first, auto&&...) const { return std::forward<decltype(first)>(first); }
 };
 
+struct GetFirstAsXvalue {
+  static constexpr decltype(auto) operator()(auto&& first, auto&&...) { return std::move(first); }
+};
+
 template <std::size_t N>
 struct ValidateTieFromIndex {
   constexpr void operator()(auto&& buffer, auto&& tuple, std::size_t idx) const {
diff --git a/libcxx/test/std/ranges/range.adaptors/range.adjacent.transform/iterator/member_types.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.adjacent.transform/iterator/member_types.compile.pass.cpp
index 684569516d747..6105dde565082 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.adjacent.transform/iterator/member_types.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.adjacent.transform/iterator/member_types.compile.pass.cpp
@@ -139,6 +139,10 @@ void test() {
   test<GetFirst, 2, int, false>();
   test<GetFirst, 3, int, false>();
 
+  test<GetFirstAsXvalue, 1, int, false>();
+  test<GetFirstAsXvalue, 2, int, false>();
+  test<GetFirstAsXvalue, 3, int, false>();
+
   test<Multiply, 1, int, true>();
   test<Multiply, 2, int, true>();
   test<Multiply, 3, int, true>();



More information about the libcxx-commits mailing list