[all-commits] [llvm/llvm-project] 85167f: [libc++] Further improve the contiguous-iterator s...

Quuxplusone via All-commits all-commits at lists.llvm.org
Fri Feb 5 12:18:57 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85167fb7c2920ca8874b197ef397e8e6b9d87c73
      https://github.com/llvm/llvm-project/commit/85167fb7c2920ca8874b197ef397e8e6b9d87c73
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2021-02-05 (Fri, 05 Feb 2021)

  Changed paths:
    M libcxx/include/algorithm
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy.pass.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.copy/copy_backward.pass.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
    M libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_constexpr.pass.cpp
    M libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_constexpr_comp.pass.cpp
    M libcxx/test/support/test_iterators.h

  Log Message:
  -----------
  [libc++] Further improve the contiguous-iterator story, and fix some bugs.

- Quality-of-implementation: Avoid calling __unwrap_iter in constexpr contexts.
    The user might conceivably write a contiguous iterator where normal iterator
    arithmetic is constexpr-friendly but `std::to_address(it)` isn't.

- Bugfix: When you pass contiguous iterators to `std::copy`, you should get
    back your contiguous iterator type, not a raw pointer. That means that
    libc++ can't `__unwrap_iter` unless it also does `__rewrap_iter`.
    Fortunately, this is implementable.

- Improve test coverage of the new `contiguous_iterator` test iterator.
    This catches the bug described above.

- Tests: Stop testing that we can `std::copy` //into// an `input_iterator`.
    Our test iterators may currently support that, but it seems nonsensical to me.

Differential Revision: https://reviews.llvm.org/D95983




More information about the All-commits mailing list