[all-commits] [llvm/llvm-project] 1821bc: [libc++] Fix the handling of `views::take` for `io...

A. Jiang via All-commits all-commits at lists.llvm.org
Mon Dec 18 12:41:28 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1821bc1e969bd2d0887fe115ae371506adc1a8be
      https://github.com/llvm/llvm-project/commit/1821bc1e969bd2d0887fe115ae371506adc1a8be
  Author: A. Jiang <de34 at live.cn>
  Date:   2023-12-18 (Mon, 18 Dec 2023)

  Changed paths:
    M libcxx/include/__ranges/take_view.h
    M libcxx/test/std/ranges/range.adaptors/range.take/adaptor.pass.cpp

  Log Message:
  -----------
  [libc++] Fix the handling of `views::take` for `iota_view` (#75683)

Currently, when libc++'s views::take specially handles an iota_view, the
addition is done after dereferencing the beginning iterator. However, in
[range.take.overview]/2.3, the addition is done before the dereferencing,
which means that the standard requires the returned iota_view to have
the same W and Bound type in such cases.

This patch fixes that, and also fixes a test that was testing the 
incorrect behavior.

Fixes #75611




More information about the All-commits mailing list