Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Time | Test | |
---|---|---|
450 ms | libcxx CI GCC 11 / C++latest > llvm-libc++-shared-gcc-cfg-in.std/iterators/iterator_requirements/iterator_cust/iterator_cust_move::iter_rvalue_reference_t.compile.pass.cpp Script:
--
: 'COMPILED WITH'; /usr/bin/g++-11 /home/libcxx-builder/.buildkite-agent/builds/b4490c974d9b-1/llvm-project/libcxx-ci/libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_rvalue_reference_t.compile.pass.cpp -nostdinc++ -isystem /home/libcxx-builder/.buildkite-agent/builds/b4490c974d9b-1/llvm-project/libcxx-ci/build/generic-gcc/include/c++/v1 -isystem /home/libcxx-builder/.buildkite-agent/builds/b4490c974d9b-1/llvm-project/libcxx-ci/build/generic-gcc/include/c++/v1 -I /home/libcxx-builder/.buildkite-agent/builds/b4490c974d9b-1/llvm-project/libcxx-ci/libcxx/test/support -std=c++2b -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-aligned-allocation-unavailable -Wno-atomic-alignment -Wno-sized-deallocation -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -D_LIBCPP_DISABLE_AVAILABILITY -fsyntax-only
|
Event Timeline
Added tests for move_sentinel. Still missing: tests for the iterator_traits of move_iterator; tests for three-way comparison; tests for iter_move and iter_swap.
libcxx/include/__iterator/move_iterator.h | ||
---|---|---|
197 | I found that writing the naïve requires requires { __x.base() == __y.base(); } here did not work; Clang complains something about accessing into incomplete type move_iterator<X> when you go to instantiate it. Pulling the constraint out into a concept outside the body of the class seems to fix the issue. |
Rebase, add more tests for comparison operators.
Could still use more tests for
- iterator_traits
- iter_move
- iter_swap
But I think this is pretty much ready to have people start hammering on it.
libcxx/include/__iterator/move_iterator.h | ||
---|---|---|
99 | s/_LIBCPP_CONSTEXPR_AFTER_CXX14/constexpr here and below since we're already guarded with #if _LIBCPP_STD_VER > 17. | |
197 | I'll buy that. I've also run into this several times in other codebases with requires requires expressions in member functions of a class template. It's not great, but the usual "pull it out to a named concept" works. |
Rebase, coalesce some repeated ifdefs, use unadorned constexpr in C++20-only codepaths
This LGTM -- I think we can add a few more tests post-commit, but this looks reasonable as-is too. I'll rebase and ship this.