This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Various cleanups in the ranges tests
ClosedPublic

Authored by ldionne on Aug 27 2021, 9:41 AM.

Details

Summary
  • Rename test files to follow conventions better
  • Split constructor tests that were in a single file
  • Add missing tests for take_view and transform_view's default constructors
  • Add missing tests for transform_view's view/function constructor
  • Fix include guards
  • Mark some tests as being specific to libc++

Diff Detail

Event Timeline

ldionne requested review of this revision.Aug 27 2021, 9:41 AM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2021, 9:41 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Quuxplusone added a subscriber: Quuxplusone.

Just skimmed, but it LGTM.

Might you be persuaded to do another cleanup patch replacing all the instances of stdr:: with std::ranges::? Two days ago I was grepping for the ranges::iterator_t tests, and was mildly irked to find we "didn't have any" (because we had stdr::iterator_t instead).

libcxx/test/std/ranges/range.access/range.access.begin/incomplete.verify.cpp
15

Grammar nit (throughout): "types" should be "type", since it's an array of (one single) incomplete type.

22–24

It might be more to the point to make this an actual SFINAE situation, like

template<class T> void f() requires std::invocable<begin_t&, T> {}
template<class T> void f() {}

https://godbolt.org/z/deP98eMvd

Also, calling this 48-line spew a "better" diagnostic is... generous. ;)

29

Tangent: Maybe the message shouldn't end with a period .

ldionne accepted this revision.Aug 30 2021, 9:35 AM
ldionne marked an inline comment as done.
ldionne added inline comments.
libcxx/test/std/ranges/range.access/range.access.begin/incomplete.verify.cpp
22–24

I'll suggest that we tackle whether or not we want this behavior at all as a separate patch.

This revision is now accepted and ready to land.Aug 30 2021, 9:35 AM
ldionne updated this revision to Diff 369468.Aug 30 2021, 9:46 AM

Address review comments

This revision was landed with ongoing or failed builds.Aug 30 2021, 9:46 AM
This revision was automatically updated to reflect the committed changes.
libcxx/test/std/ranges/range.utility/range.subrange/ctor.range_size.pass.cpp