[all-commits] [llvm/llvm-project] 4a47ac: [libc++] Remove incorrect default constructor in c...

Louis Dionne via All-commits all-commits at lists.llvm.org
Tue Jan 4 11:34:03 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a47ac7d514c151883a0b9a98f7c3071229c13a5
      https://github.com/llvm/llvm-project/commit/4a47ac7d514c151883a0b9a98f7c3071229c13a5
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2022-01-04 (Tue, 04 Jan 2022)

  Changed paths:
    M libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.addressof.compile.pass.cpp
    M libcxx/test/std/containers/sequences/vector/vector.modifiers/insert_iter_iter_iter.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/iterator_sentinel.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_count_sentinel.pass.cpp
    M libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/iterator_sentinel.pass.cpp
    M libcxx/test/std/iterators/predef.iterators/counted.iterator/ctor.default.pass.cpp
    M libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.const/default.pass.cpp
    M libcxx/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op=/move_iterator.pass.cpp
    M libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/ctor.default.pass.cpp
    M libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/member_types.compile.pass.cpp
    M libcxx/test/std/ranges/range.req/range.range/sentinel_t.compile.pass.cpp
    M libcxx/test/std/ranges/range.req/range.refinements/common_range.compile.pass.cpp
    M libcxx/test/std/ranges/range.req/range.refinements/input_range.compile.pass.cpp
    M libcxx/test/std/ranges/range.utility/range.subrange/advance.pass.cpp
    M libcxx/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
    M libcxx/test/std/strings/basic.string/string.modifiers/string_assign/iterator.pass.cpp
    M libcxx/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
    M libcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_iter_iter.pass.cpp
    M libcxx/test/support/test_iterators.h

  Log Message:
  -----------
  [libc++] Remove incorrect default constructor in cpp17_input_iterator

AFAICT, Cpp17InputIterators are not required to be default constructible,
since that requirement is added in Cpp17ForwardIterator. Hence, our
archetype for Cpp17InputIterator should not be default constructible.
Removing that constructor has a ripple effect on a couple of tests that
were making incorrect assumptions. Notably:

- Some tests were using cpp17_input_iterator as a sentinel for itself.
  That is not valid, because a cpp17_input_iterator is not semiregular
  anymore after the change (and hence it doesn't satisfy sentinel_for).

- Some tests were using a stride-counted cpp17_input_iterator as the
  sentinel for a range. This doesn't work anymore because of the problem
  above, so these tests were changed not to check stride counts for
  input iterators.

- Some tests were default constructing cpp17_input_iterator when a simple
  alternative was available -- those have been changed to use that alternative.

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




More information about the All-commits mailing list