Page MenuHomePhabricator

[libcxx][ranges] Add ranges::ssize CPO.
ClosedPublic

Authored by zoecarver on Apr 23 2021, 11:24 AM.

Details

Summary

Based on D101079.

Diff Detail

Unit TestsFailed

TimeTest
3,200 mslibcxx CI Armv7 > libc++.std/ranges/range_access/range_prim::size.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/local/bin/c++ /home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/libcxx/test/std/ranges/range.access/range.prim/size.pass.cpp -v --target=armv7-linux-gnueabihf -include /home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/include/c++/v1 -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++20 -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/projects/libcxx/test/std/ranges/range.access/range.prim/Output/size.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -lc++experimental -L/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/./lib -Wl,-rpath,/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/./lib -L/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/./lib -Wl,-rpath,/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/./lib -nodefaultlibs -lc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc -latomic -o /home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm…
2,970 mslibcxx CI Armv7 > libc++.std/ranges/range_access/range_prim::ssize.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/local/bin/c++ /home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/libcxx/test/std/ranges/range.access/range.prim/ssize.pass.cpp -v --target=armv7-linux-gnueabihf -include /home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/include/c++/v1 -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++20 -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/projects/libcxx/test/std/ranges/range.access/range.prim/Output/ssize.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -lc++experimental -L/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/./lib -Wl,-rpath,/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/./lib -L/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/./lib -Wl,-rpath,/home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm-project/libcxx-ci/build/armv7/./lib -nodefaultlibs -lc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc -latomic -o /home/tcwg-buildslave/worker/linaro-armv8-libcxx-04/llvm…
3,560 mslibcxx CI Armv7 -fno-exceptions > libc++.std/ranges/range_access/range_prim::size.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/local/bin/c++ /home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/libcxx/test/std/ranges/range.access/range.prim/size.pass.cpp -v --target=armv7-linux-gnueabihf -include /home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/include/c++/v1 -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++20 -fno-exceptions -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/projects/libcxx/test/std/ranges/range.access/range.prim/Output/size.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -lc++experimental -L/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/./lib -Wl,-rpath,/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/./lib -L/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/./lib -Wl,-rpath,/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/./lib -nodefaultlibs -lc++ -lm…
2,780 mslibcxx CI Armv7 -fno-exceptions > libc++.std/ranges/range_access/range_prim::ssize.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/local/bin/c++ /home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/libcxx/test/std/ranges/range.access/range.prim/ssize.pass.cpp -v --target=armv7-linux-gnueabihf -include /home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/include/c++/v1 -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++20 -fno-exceptions -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/projects/libcxx/test/std/ranges/range.access/range.prim/Output/ssize.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -lc++experimental -L/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/./lib -Wl,-rpath,/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/./lib -L/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/./lib -Wl,-rpath,/home/tcwg-buildslave/worker/linaro-armv8-libcxx-02/llvm-project/libcxx-ci/build/armv7-noexceptions/./lib -nodefaultlibs -lc++ -lm…
2,420 mslibcxx CI Armv8 > libc++.std/ranges/range_access/range_prim::size.pass.cpp
Script: -- : 'COMPILED WITH'; /usr/local/bin/c++ /home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/libcxx/test/std/ranges/range.access/range.prim/size.pass.cpp -v --target=armv8-linux-gnueabihf -include /home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/libcxx/test/support/nasty_macros.h -nostdinc++ -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/include/c++/v1 -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/projects/libcxx/include/c++build -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I/home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/libcxx/test/support -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -std=c++20 -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DISABLE_AVAILABILITY -fcoroutines-ts -Werror=thread-safety -Wuser-defined-warnings -fmodules-cache-path=/home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/projects/libcxx/test/std/ranges/range.access/range.prim/Output/size.pass.cpp.dir/t.tmp/ModuleCache -Wno-macro-redefined -D_LIBCPP_HAS_THREAD_API_PTHREAD -Wno-macro-redefined -D_LIBCPP_ABI_VERSION=1 -lc++experimental -L/home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/./lib -Wl,-rpath,/home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/./lib -L/home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/./lib -Wl,-rpath,/home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm-project/libcxx-ci/build/armv8/./lib -nodefaultlibs -lc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc -latomic -o /home/tcwg-buildslave/worker/linaro-armv8-libcxx-03/llvm…
View Full Test Results (10 Failed)

Event Timeline

zoecarver requested review of this revision.Apr 23 2021, 11:24 AM
zoecarver created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2021, 11:24 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
cjdb added inline comments.Apr 23 2021, 11:37 AM
libcxx/include/__ranges/size.h
103–104

invocable<__size::__fn, _Tp>?

zoecarver updated this revision to Diff 340170.Apr 23 2021, 2:37 PM
  • Use invocable
  • Rebase
ldionne accepted this revision.Apr 30 2021, 2:57 PM

LGTM with changes applied.

libcxx/include/__ranges/size.h
108

Here instead I would just write

require (_Tp&& __t) { ranges::size(__t); }

and get rid of __can_invoke_size. Closer to the spec and simpler IMO.

libcxx/test/std/ranges/range.access/range.prim/size.pass.cpp
45

Can we move the ssize tests to their own file?

This revision is now accepted and ready to land.Apr 30 2021, 2:57 PM
cjdb accepted this revision.Apr 30 2021, 3:19 PM

LGTM with a semiregular test!

zoecarver updated this revision to Diff 342560.May 3 2021, 3:07 PM
  • Rebase
  • Address Louis' comments
zoecarver updated this revision to Diff 342772.May 4 2021, 9:19 AM
  • Compute size types so they are correct on windows and 32bit.
ldionne accepted this revision.May 4 2021, 2:49 PM

LGTM (please update synopsis).

By the way, no need to re-run CI for such minor changes. Just make the change and ship it, no need to add any more latency to the loop.

zoecarver updated this revision to Diff 342901.May 4 2021, 4:20 PM
  • Add synopsis.
  • Rebase so the tests pass here too.
This revision was automatically updated to reflect the committed changes.