Skip to content

[libc++][ranges][test-suite][NFC] Consistency improvements after P3050 merge - #213062

Merged
Zingam merged 2 commits into
llvm:mainfrom
H-G-Hristov:hgh/libcxx/P3050-NFC-changes
Jul 31, 2026
Merged

[libc++][ranges][test-suite][NFC] Consistency improvements after P3050 merge#213062
Zingam merged 2 commits into
llvm:mainfrom
H-G-Hristov:hgh/libcxx/P3050-NFC-changes

Conversation

@H-G-Hristov

@H-G-Hristov H-G-Hristov commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Consistency improvements and other small tweaks.

A follow-up to #193891 - the changes were deferred to reduce the size of an already large and approved PR.

Use concepts, instead of type traits consistently and other small tweaks.

A follow-up to llvm#193891
@H-G-Hristov
H-G-Hristov requested a review from a team as a code owner July 30, 2026 16:28
@Zingam
Zingam requested a review from frederick-vs-ja July 30, 2026 16:29
@Zingam Zingam changed the title [libc++][ranges][NFC] Consistency improvements after P3050 [libc++][ranges][test-suite][NFC] Consistency improvements after P3050 Jul 30, 2026
@llvmorg-github-actions llvmorg-github-actions Bot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jul 30, 2026
@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-libcxx

Author: Hristo Hristov (H-G-Hristov)

Changes

Use concepts instead of type traits consistently and other small tweaks.

A follow-up to #193891 - the changes were deferred to reduce the size of an already large and approved PR.


Full diff: https://github.com/llvm/llvm-project/pull/213062.diff

20 Files Affected:

  • (modified) libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.base.compile.pass.cpp (+3-3)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/ctor.base.compile.pass.cpp (+3-3)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.filter/iterator/ctor.parent.iter.compile.pass.cpp (+1)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.filter/sentinel/ctor.parent.compile.pass.cpp (+1)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.parent.compile.pass.cpp (+4-2)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/ctor.outer_iterator.compile.pass.cpp (+5-4)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.base.compile.pass.cpp (+3-2)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.compile.pass.cpp (+4-3)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.split/iterator/base.pass.cpp (+3-1)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.split/iterator/ctor.parent.iter.subrange.compile.pass.cpp (+2-2)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.split/iterator/deref.pass.cpp (+5-1)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.split/sentinel/ctor.parent.compile.pass.cpp (+3-2)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/ctor.base.pred.compile.pass.cpp (+2-2)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/ctor.convert.pass.cpp (+3-3)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.base.compile.pass.cpp (+3-3)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.parent.iter.compile.pass.cpp (+2-1)
  • (modified) libcxx/test/std/ranges/range.adaptors/range.transform/sentinel/ctor.base.compile.pass.cpp (+3-2)
  • (modified) libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.value.compile.pass.cpp (+9-5)
  • (modified) libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.value.compile.pass.cpp (+4-3)
  • (modified) libcxx/test/std/ranges/range.factories/range.istream.view/iterator/ctor.parent.compile.pass.cpp (+1-1)
diff --git a/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.base.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.base.compile.pass.cpp
index b43a60276e280..b13b1a3cf91e1 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.base.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.elements/iterator/ctor.base.compile.pass.cpp
@@ -12,12 +12,12 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
 #include <tuple>
-#include <type_traits>
 
 using BaseIter     = std::tuple<int>*;
 using ElementsIter = std::ranges::iterator_t<std::ranges::elements_view<std::ranges::subrange<BaseIter, BaseIter>, 0>>;
 
-static_assert(!std::is_constructible_v<ElementsIter, BaseIter>);
-static_assert(!std::is_convertible_v<BaseIter, ElementsIter>);
+static_assert(!std::constructible_from<ElementsIter, BaseIter>);
+static_assert(!std::convertible_to<BaseIter, ElementsIter>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/ctor.base.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/ctor.base.compile.pass.cpp
index bbdc797b03e9c..206c5fd95f996 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/ctor.base.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.elements/sentinel/ctor.base.compile.pass.cpp
@@ -12,8 +12,8 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
-#include <type_traits>
 
 struct Sent {
   int i;
@@ -28,5 +28,5 @@ struct Range : std::ranges::view_base {
 
 using ElementsView = std::ranges::elements_view<Range, 0>;
 
-static_assert(!std::is_constructible_v<std::ranges::sentinel_t<ElementsView>, Sent>);
-static_assert(!std::is_convertible_v<Sent, std::ranges::sentinel_t<ElementsView>>);
+static_assert(!std::constructible_from<std::ranges::sentinel_t<ElementsView>, Sent>);
+static_assert(!std::convertible_to<Sent, std::ranges::sentinel_t<ElementsView>>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/ctor.parent.iter.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/ctor.parent.iter.compile.pass.cpp
index 47deabb7136c6..6f196243e34d9 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/ctor.parent.iter.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.filter/iterator/ctor.parent.iter.compile.pass.cpp
@@ -12,6 +12,7 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
 
 #include "test_iterators.h"
diff --git a/libcxx/test/std/ranges/range.adaptors/range.filter/sentinel/ctor.parent.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.filter/sentinel/ctor.parent.compile.pass.cpp
index 06e06aeb6db6e..dadf674c5e617 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.filter/sentinel/ctor.parent.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.filter/sentinel/ctor.parent.compile.pass.cpp
@@ -12,6 +12,7 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
 
 #include "test_iterators.h"
diff --git a/libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.parent.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.parent.compile.pass.cpp
index 504c945e3d918..008f0f1811679 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.parent.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.parent.compile.pass.cpp
@@ -12,10 +12,12 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
 
 #include "../types.h"
 
 using Parent = std::ranges::join_view<ParentView<ChildView>>;
-static_assert(!std::is_constructible_v<std::ranges::sentinel_t<Parent>, Parent&>);
-static_assert(!std::is_convertible_v<std::ranges::sentinel_t<Parent>, Parent&>);
+
+static_assert(!std::constructible_from<std::ranges::sentinel_t<Parent>, Parent&>);
+static_assert(!std::convertible_to<std::ranges::sentinel_t<Parent>, Parent&>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/ctor.outer_iterator.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/ctor.outer_iterator.compile.pass.cpp
index 37fe2fadfd41a..7b3f7b0731cf2 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/ctor.outer_iterator.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.inner/ctor.outer_iterator.compile.pass.cpp
@@ -12,12 +12,13 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
 
 #include "../types.h"
 
-static_assert(!std::is_constructible_v<InnerIterConst, OuterIterConst>);
-static_assert(!std::is_convertible_v<InnerIterConst, OuterIterConst>);
+static_assert(!std::constructible_from<InnerIterConst, OuterIterConst>);
+static_assert(!std::convertible_to<InnerIterConst, OuterIterConst>);
 
-static_assert(!std::is_constructible_v<InnerIterNonConst, OuterIterNonConst>);
-static_assert(!std::is_convertible_v<InnerIterNonConst, OuterIterNonConst>);
+static_assert(!std::constructible_from<InnerIterNonConst, OuterIterNonConst>);
+static_assert(!std::convertible_to<InnerIterNonConst, OuterIterNonConst>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.base.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.base.compile.pass.cpp
index 70e97ea04f5c0..95478981865b9 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.base.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.base.compile.pass.cpp
@@ -13,10 +13,11 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
-#include <type_traits>
 
 #include "../types.h"
 
 static_assert(std::ranges::forward_range<SplitViewForward>);
-static_assert(!std::is_constructible_v<OuterIterForward, SplitViewForward&, std::ranges::iterator_t<ForwardView>>);
+
+static_assert(!std::constructible_from<OuterIterForward, SplitViewForward&, std::ranges::iterator_t<ForwardView>>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.compile.pass.cpp
index b838970718c8a..a0cb79544d66a 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/ctor.parent.compile.pass.cpp
@@ -13,11 +13,12 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
-#include <type_traits>
 
 #include "../types.h"
 
 static_assert(!std::ranges::forward_range<SplitViewInput>);
-static_assert(!std::is_constructible_v<OuterIterInput, SplitViewInput&>);
-static_assert(!std::is_convertible_v<SplitViewInput&, OuterIterInput>);
+
+static_assert(!std::constructible_from<OuterIterInput, SplitViewInput&>);
+static_assert(!std::convertible_to<SplitViewInput&, OuterIterInput>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.split/iterator/base.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.split/iterator/base.pass.cpp
index 8e8eff8a12b97..e2a884c0d7f1c 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.split/iterator/base.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.split/iterator/base.pass.cpp
@@ -16,9 +16,11 @@
 #include "../types.h"
 
 struct Iter : ForwardIterBase<Iter> {
-  int i            = 0;
+  int i = 0;
+
   constexpr Iter() = default;
   constexpr Iter(int ii) : i(ii) {}
+
   constexpr int operator*() const { return i; }
   constexpr Iter& operator++() {
     ++i;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.split/iterator/ctor.parent.iter.subrange.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.split/iterator/ctor.parent.iter.subrange.compile.pass.cpp
index 9f4e9a13e0447..b18045b2e784e 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.split/iterator/ctor.parent.iter.subrange.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.split/iterator/ctor.parent.iter.subrange.compile.pass.cpp
@@ -12,8 +12,8 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
-#include <type_traits>
 
 #include "../types.h"
 
@@ -35,4 +35,4 @@ struct TracedMoveView : std::ranges::view_base {
 using SplitView = std::ranges::split_view<TracedMoveView, TracedMoveView>;
 using SplitIter = std::ranges::iterator_t<SplitView>;
 
-static_assert(!std::is_constructible_v<SplitIter, SplitView, TracedMoveIter, std::ranges::subrange<TracedMoveIter>>);
+static_assert(!std::constructible_from<SplitIter, SplitView, TracedMoveIter, std::ranges::subrange<TracedMoveIter>>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.split/iterator/deref.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.split/iterator/deref.pass.cpp
index 0e9812020fb38..1906c48aff5e3 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.split/iterator/deref.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.split/iterator/deref.pass.cpp
@@ -17,9 +17,11 @@
 #include "../types.h"
 
 struct Iter : ForwardIterBase<Iter> {
-  int i            = 0;
+  int i = 0;
+
   constexpr Iter() = default;
   constexpr Iter(int ii) : i(ii) {}
+
   constexpr int operator*() const { return i; }
   constexpr Iter& operator++() {
     ++i;
@@ -38,8 +40,10 @@ constexpr bool test() {
   using SplitIter = std::ranges::iterator_t<SplitView>;
 
   SplitView sv{std::ranges::subrange<Iter>{Iter{5}, Iter{8}}, std::ranges::subrange<Iter>{Iter{7}, Iter{8}}};
+
   const SplitIter it                                             = sv.begin();
   std::same_as<std::ranges::subrange<Iter>> decltype(auto) value = *it;
+
   assert(value.begin().i == 5);
   assert(value.end().i == 7);
 
diff --git a/libcxx/test/std/ranges/range.adaptors/range.split/sentinel/ctor.parent.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.split/sentinel/ctor.parent.compile.pass.cpp
index e0e8029c4c538..3c6c0d007ea12 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.split/sentinel/ctor.parent.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.split/sentinel/ctor.parent.compile.pass.cpp
@@ -12,6 +12,7 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
 
 #include "../types.h"
@@ -20,5 +21,5 @@ using Range     = std::ranges::subrange<int*, sentinel_wrapper<int*>>;
 using SplitView = std::ranges::split_view<Range, std::ranges::single_view<int>>;
 using SplitSent = std::ranges::sentinel_t<SplitView>;
 
-static_assert(!std::is_constructible_v<SplitSent, SplitView&>);
-static_assert(!std::is_convertible_v<SplitView&, SplitSent>);
+static_assert(!std::constructible_from<SplitSent, SplitView&>);
+static_assert(!std::convertible_to<SplitView&, SplitSent>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/ctor.base.pred.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/ctor.base.pred.compile.pass.cpp
index a66e3d1e84c6e..ae96b8e12c3c3 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/ctor.base.pred.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/ctor.base.pred.compile.pass.cpp
@@ -12,8 +12,8 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
-#include <type_traits>
 
 struct Sent {
   int i;
@@ -32,4 +32,4 @@ struct Pred {
 
 using Sentinel = std::ranges::sentinel_t<std::ranges::take_while_view<Range, Pred>>;
 
-static_assert(!std::is_constructible_v<Sentinel, std::ranges::sentinel_t<Range>, const Pred*>);
+static_assert(!std::constructible_from<Sentinel, std::ranges::sentinel_t<Range>, const Pred*>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/ctor.convert.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/ctor.convert.pass.cpp
index 1808545422498..3b41739590976 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/ctor.convert.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take.while/sentinel/ctor.convert.pass.cpp
@@ -131,8 +131,8 @@ constexpr bool test() {
 
     struct Rng : std::ranges::view_base {
       constexpr int* begin() const { return nullptr; }
-      constexpr Sent end() { return Sent{0}; }
-      constexpr MoveOnlyConvert end() const { return MoveOnlyConvert(Sent{0}); }
+      constexpr Sent end() { return Sent{5}; }
+      constexpr MoveOnlyConvert end() const { return MoveOnlyConvert(Sent{7}); }
     };
 
     using R             = std::ranges::take_while_view<Rng, TestPred>;
@@ -143,7 +143,7 @@ constexpr bool test() {
     R r{Rng{}, TestPred{}};
     Sentinel s1      = r.end();
     ConstSentinel s2 = s1;
-    assert(s2.base().i == 0);
+    assert(s2.base().i == 5);
   }
 
   return true;
diff --git a/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.base.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.base.compile.pass.cpp
index 9383508165609..55021d79968a3 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.base.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/range.take.sentinel/ctor.base.compile.pass.cpp
@@ -12,8 +12,8 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
-#include <type_traits>
 
 #include "test_iterators.h"
 #include "../types.h"
@@ -21,5 +21,5 @@
 using TakeView = std::ranges::take_view<MoveOnlyView>;
 using Sentinel = std::ranges::sentinel_t<TakeView>;
 
-static_assert(!std::is_constructible_v<Sentinel, sentinel_wrapper<int*>>);
-static_assert(!std::is_convertible_v<sentinel_wrapper<int*>, Sentinel>);
+static_assert(!std::constructible_from<Sentinel, sentinel_wrapper<int*>>);
+static_assert(!std::convertible_to<sentinel_wrapper<int*>, Sentinel>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.parent.iter.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.parent.iter.compile.pass.cpp
index 37b6016e439fb..8d59264269711 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.parent.iter.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/iterator/ctor.parent.iter.compile.pass.cpp
@@ -12,6 +12,7 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
 
 #include "../types.h"
@@ -20,4 +21,4 @@ using TransformView         = std::ranges::transform_view<MoveOnlyView, PlusOne>
 using TransformViewBaseIter = std::ranges::iterator_t<MoveOnlyView>;
 using TransformIter         = std::ranges::iterator_t<TransformView>;
 
-static_assert(!std::is_constructible_v<TransformIter, TransformView&, TransformViewBaseIter>);
+static_assert(!std::constructible_from<TransformIter, TransformView&, TransformViewBaseIter>);
diff --git a/libcxx/test/std/ranges/range.adaptors/range.transform/sentinel/ctor.base.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.transform/sentinel/ctor.base.compile.pass.cpp
index b5f134528fef0..869e26e1af90a 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.transform/sentinel/ctor.base.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.transform/sentinel/ctor.base.compile.pass.cpp
@@ -12,6 +12,7 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
 
 #include "test_iterators.h"
@@ -21,5 +22,5 @@ using BaseSent      = std::ranges::sentinel_t<SizedSentinelView>;
 using TransformView = std::ranges::transform_view<SizedSentinelView, PlusOne>;
 using TransformSent = std::ranges::sentinel_t<TransformView>;
 
-static_assert(!std::is_constructible_v<TransformSent, BaseSent>);
-static_assert(!std::is_convertible_v<BaseSent, TransformSent>);
+static_assert(!std::constructible_from<TransformSent, BaseSent>);
+static_assert(!std::convertible_to<BaseSent, TransformSent>);
diff --git a/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.value.compile.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.value.compile.pass.cpp
index fc3384e191d1d..f40f01a88b158 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.value.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/ctor.value.compile.pass.cpp
@@ -12,13 +12,17 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
-#include <type_traits>
 
 #include "../types.h"
 
-static_assert(!std::is_constructible_v<std::ranges::iterator_t<std::ranges::iota_view<int>>, int>);
+using IntIter = std::ranges::iterator_t<std::ranges::iota_view<int>>;
 
-using Iter = std::ranges::iterator_t<std::ranges::iota_view<SomeInt>>;
-static_assert(!std::is_constructible_v<Iter, SomeInt>);
-static_assert(!std::is_convertible_v<SomeInt, Iter>);
+static_assert(!std::constructible_from<IntIter, int>);
+static_assert(!std::convertible_to<int, IntIter>);
+
+using SomeIntIter = std::ranges::iterator_t<std::ranges::iota_view<SomeInt>>;
+
+static_assert(!std::constructible_from<SomeIntIter, SomeInt>);
+static_assert(!std::convertible_to<SomeInt, SomeIntIter>);
diff --git a/libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.value.compile.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.value.compile.pass.cpp
index b0bcdb6c60ce7..93bb65745f87f 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.value.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/sentinel/ctor.value.compile.pass.cpp
@@ -12,11 +12,12 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
-#include <type_traits>
 
 #include "../types.h"
 
 using Sent = std::ranges::sentinel_t<std::ranges::iota_view<SomeInt, IntSentinelWith<SomeInt>>>;
-static_assert(!std::is_constructible_v<Sent, IntSentinelWith<SomeInt>>);
-static_assert(!std::is_convertible_v<IntSentinelWith<SomeInt>, Sent>);
+
+static_assert(!std::constructible_from<Sent, IntSentinelWith<SomeInt>>);
+static_assert(!std::convertible_to<IntSentinelWith<SomeInt>, Sent>);
diff --git a/libcxx/test/std/ranges/range.factories/range.istream.view/iterator/ctor.parent.compile.pass.cpp b/libcxx/test/std/ranges/range.factories/range.istream.view/iterator/ctor.parent.compile.pass.cpp
index 04ff9ac24d731..51c92dac50ce2 100644
--- a/libcxx/test/std/ranges/range.factories/range.istream.view/iterator/ctor.parent.compile.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.istream.view/iterator/ctor.parent.compile.pass.cpp
@@ -13,9 +13,9 @@
 
 // The constructor is now `private` (exposition-only) per P3059R2.
 
+#include <concepts>
 #include <ranges>
 #include <sstream>
-#include <type_traits>
 
 #include "test_macros.h"
 

@Zingam
Zingam marked this pull request as draft July 31, 2026 01:54
@Zingam Zingam changed the title [libc++][ranges][test-suite][NFC] Consistency improvements after P3050 [libc++][ranges][test-suite][NFC] Consistency improvements after P3050 merge Jul 31, 2026
@Zingam
Zingam marked this pull request as ready for review July 31, 2026 05:48
@Zingam
Zingam requested a review from frederick-vs-ja July 31, 2026 05:48
@frederick-vs-ja frederick-vs-ja added the pending-ci Merging the PR is only pending completion of CI label Jul 31, 2026
@Zingam
Zingam merged commit 34de439 into llvm:main Jul 31, 2026
86 checks passed
@H-G-Hristov
H-G-Hristov deleted the hgh/libcxx/P3050-NFC-changes branch July 31, 2026 19:01
@frederick-vs-ja frederick-vs-ja removed the pending-ci Merging the PR is only pending completion of CI label Aug 1, 2026
frederik-h pushed a commit to frederik-h/llvm-project that referenced this pull request Aug 3, 2026
…0 merge (llvm#213062)

Consistency improvements and other small tweaks.

A follow-up to llvm#193891 - the
changes were deferred to reduce the size of an already large and
approved PR.
jgreenbaum pushed a commit to jgreenbaum/llvm-project that referenced this pull request Aug 3, 2026
…0 merge (llvm#213062)

Consistency improvements and other small tweaks.

A follow-up to llvm#193891 - the
changes were deferred to reduce the size of an already large and
approved PR.
tfzee pushed a commit to tfzee/llvm-project that referenced this pull request Aug 6, 2026
…0 merge (llvm#213062)

Consistency improvements and other small tweaks.

A follow-up to llvm#193891 - the
changes were deferred to reduce the size of an already large and
approved PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. test-suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants