Page MenuHomePhabricator

[libc++][ranges] implement `std::ranges::drop_while_view`
ClosedPublic

Authored by huixie90 on Oct 7 2022, 10:11 AM.

Diff Detail

Unit TestsFailed

TimeTest
1,240 mslibcxx CI AArch64 -fno-exceptions > llvm-libc++-shared-cfg-in.libcxx/ranges/range_adaptors/range_drop_while::assert.begin.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/local/bin/c++ /home/tcwg-buildbot/worker/linaro-aarch64-libcxx-02/llvm-project/libcxx-ci/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp --target=aarch64-linux-gnu -nostdinc++ -I /home/tcwg-buildbot/worker/linaro-aarch64-libcxx-02/llvm-project/libcxx-ci/build/aarch64-noexceptions/include/c++/v1 -I /home/tcwg-buildbot/worker/linaro-aarch64-libcxx-02/llvm-project/libcxx-ci/build/aarch64-noexceptions/include/c++/v1 -I /home/tcwg-buildbot/worker/linaro-aarch64-libcxx-02/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -fno-exceptions -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ENABLE_ASSERTIONS=1 -lc++experimental -nostdlib++ -L /home/tcwg-buildbot/worker/linaro-aarch64-libcxx-02/llvm-project/libcxx-ci/build/aarch64-noexceptions/lib -Wl,-rpath,/home/tcwg-buildbot/worker/linaro-aarch64-libcxx-02/llvm-project/libcxx-ci/build/aarch64-noexceptions/lib -lc++ -pthread -o /home/tcwg-buildbot/worker/linaro-aarch64-libcxx-02/llvm-project/libcxx-ci/build/aarch64-noexceptions/test/libcxx/ranges/range.adaptors/range.drop.while/Output/assert.begin.pass.cpp.dir/t.tmp.exe
1,270 mslibcxx CI Armv7 -fno-exceptions > llvm-libc++-shared-cfg-in.libcxx/ranges/range_adaptors/range_drop_while::assert.begin.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/local/bin/c++ /home/tcwg-buildbot/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp --target=armv7l-linux-gnueabihf -nostdinc++ -I /home/tcwg-buildbot/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7-noexceptions/include/c++/v1 -I /home/tcwg-buildbot/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7-noexceptions/include/c++/v1 -I /home/tcwg-buildbot/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -fno-exceptions -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ENABLE_ASSERTIONS=1 -lc++experimental -nostdlib++ -L /home/tcwg-buildbot/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7-noexceptions/lib -Wl,-rpath,/home/tcwg-buildbot/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7-noexceptions/lib -lc++ -pthread -o /home/tcwg-buildbot/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7-noexceptions/test/libcxx/ranges/range.adaptors/range.drop.while/Output/assert.begin.pass.cpp.dir/t.tmp.exe
1,280 mslibcxx CI Armv8 -fno-exceptions > llvm-libc++-shared-cfg-in.libcxx/ranges/range_adaptors/range_drop_while::assert.begin.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/local/bin/c++ /home/tcwg-buildbot/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp --target=armv8l-linux-gnueabihf -nostdinc++ -I /home/tcwg-buildbot/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv8-noexceptions/include/c++/v1 -I /home/tcwg-buildbot/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv8-noexceptions/include/c++/v1 -I /home/tcwg-buildbot/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -fno-exceptions -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ENABLE_ASSERTIONS=1 -lc++experimental -nostdlib++ -L /home/tcwg-buildbot/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv8-noexceptions/lib -Wl,-rpath,/home/tcwg-buildbot/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv8-noexceptions/lib -lc++ -pthread -o /home/tcwg-buildbot/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv8-noexceptions/test/libcxx/ranges/range.adaptors/range.drop.while/Output/assert.begin.pass.cpp.dir/t.tmp.exe
1,310 mslibcxx CI No exceptions > llvm-libc++-shared-cfg-in.libcxx/ranges/range_adaptors/range_drop_while::assert.begin.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/bin/clang++-16 /home/libcxx-builder/.buildkite-agent/builds/fa2686b4f1c9-1/llvm-project/libcxx-ci/libcxx/test/libcxx/ranges/range.adaptors/range.drop.while/assert.begin.pass.cpp --target=x86_64-unknown-linux-gnu -nostdinc++ -I /home/libcxx-builder/.buildkite-agent/builds/fa2686b4f1c9-1/llvm-project/libcxx-ci/build/generic-noexceptions/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/fa2686b4f1c9-1/llvm-project/libcxx-ci/build/generic-noexceptions/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/fa2686b4f1c9-1/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -fno-exceptions -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-noexcept-type -Wno-atomic-alignment -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -D_LIBCPP_ENABLE_ASSERTIONS=1 -lc++experimental -nostdlib++ -L /home/libcxx-builder/.buildkite-agent/builds/fa2686b4f1c9-1/llvm-project/libcxx-ci/build/generic-noexceptions/lib -Wl,-rpath,/home/libcxx-builder/.buildkite-agent/builds/fa2686b4f1c9-1/llvm-project/libcxx-ci/build/generic-noexceptions/lib -lc++ -pthread -o /home/libcxx-builder/.buildkite-agent/builds/fa2686b4f1c9-1/llvm-project/libcxx-ci/build/generic-noexceptions/test/libcxx/ranges/range.adaptors/range.drop.while/Output/assert.begin.pass.cpp.dir/t.tmp.exe

Event Timeline

huixie90 created this revision.Oct 7 2022, 10:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 10:11 AM
huixie90 requested review of this revision.Oct 7 2022, 10:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 10:11 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Oct 14 2022, 9:19 AM
ldionne added inline comments.
libcxx/include/__ranges/drop_while_view.h
69

Maybe that's a bit better for a user? Per live review, we think that's the only situation that can lead us to this assertion failing.

Also, this is non-blocking because extremely pedantic, but it might be nice to add an assert.<xxxxxx>.pass.cpp test to check that behavior. You can take inspiration of other tests like libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp.

libcxx/test/std/ranges/range.adaptors/range.drop.while/ctor.default.pass.cpp
18

Same below.

20–23

Maybe you could initialize i to a non-zero value just to rule out the fact that we're accessing zeroed-by-chance memory that would be uninitialized below?

libcxx/test/std/ranges/range.adaptors/range.drop.while/general.pass.cpp
21

Maybe that's closer to what a user would actually write?

This revision is now accepted and ready to land.Oct 14 2022, 9:19 AM
huixie90 updated this revision to Diff 468169.Oct 17 2022, 5:10 AM
huixie90 marked 4 inline comments as done.

addressed comments