This is an archive of the discontinued LLVM Phabricator instance.

[libc++][ranges] Implement the changes to container adaptors from P1206 (`ranges::to`):
ClosedPublic

Authored by var-const on May 4 2023, 2:28 AM.

Details

Summary
  • add the from_range_t constructors and the related deduction guides;
  • add the push_range member function.

(Note: this patch is split from https://reviews.llvm.org/D142335)

Diff Detail

Event Timeline

var-const created this revision.May 4 2023, 2:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 2:28 AM
var-const requested review of this revision.May 4 2023, 2:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2023, 2:28 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

Rebase; copy the changes to include/deque from D149827 to make the patch compile.

var-const updated this revision to Diff 522878.May 16 2023, 7:03 PM

Fix the CI.

Rebase (which makes the changes to deque go away).

ldionne accepted this revision.Jun 1 2023, 12:37 PM
ldionne added a subscriber: ldionne.

This LGTM w/ a few comments! Thanks!

libcxx/test/std/containers/container.adaptors/from_range_container_adaptors.h
10

This include guard is wrong.

91

IMO these should move out of this file and be local to priority.queue/from_range.pass.cpp.

libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/from_range.pass.cpp
18–23

Nitpick, but let's move those above includes. Please check in other test files too.

libcxx/test/support/unwrap_container_adaptor.h
24–30

This doesn't require C++20.

This revision is now accepted and ready to land.Jun 1 2023, 12:37 PM

We're seeing some failures related to the following tests in our CI after this patch. Other failures are masking our CI right now so I'm not 100% sure this is still an issue, but I didn't notice any forward fixes or reverts related to this change.

Failing bot: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8779076649243827361/overview

llvm-libc++-static.cfg.in :: /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/test/libcxx/transitive_includes.gen.py/queue.sh.cpp
llvm-libc++-static.cfg.in :: /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/test/libcxx/transitive_includes.gen.py/stack.sh.cpp

********************
Failed Tests (2):
  llvm-libc++-static.cfg.in :: /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/test/libcxx/transitive_includes.gen.py/queue.sh.cpp
  llvm-libc++-static.cfg.in :: /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/test/libcxx/transitive_includes.gen.py/stack.sh.cpp


Testing Time: 318.39s
  Skipped          :    18
  Unsupported      :  2666
  Passed           : 14168
  Expectedly Failed:   102
  Failed           :     2
FAILED: CMakeFiles/check-runtimes /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/CMakeFiles/check-runtimes

We're seeing some failures related to the following tests in our CI after this patch. Other failures are masking our CI right now so I'm not 100% sure this is still an issue, but I didn't notice any forward fixes or reverts related to this change.

Failing bot: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8779076649243827361/overview

llvm-libc++-static.cfg.in :: /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/test/libcxx/transitive_includes.gen.py/queue.sh.cpp
llvm-libc++-static.cfg.in :: /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/test/libcxx/transitive_includes.gen.py/stack.sh.cpp

********************
Failed Tests (2):
  llvm-libc++-static.cfg.in :: /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/test/libcxx/transitive_includes.gen.py/queue.sh.cpp
  llvm-libc++-static.cfg.in :: /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/test/libcxx/transitive_includes.gen.py/stack.sh.cpp


Testing Time: 318.39s
  Skipped          :    18
  Unsupported      :  2666
  Passed           : 14168
  Expectedly Failed:   102
  Failed           :     2
FAILED: CMakeFiles/check-runtimes /b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/CMakeFiles/check-runtimes

I committed a fix for this yesterday. Is this issue still present for you?