[all-commits] [llvm/llvm-project] bc4d2e: [libc++] Fix `_IterOps::__iter_move` to support pr...

Konstantin Varlamov via All-commits all-commits at lists.llvm.org
Wed Jul 20 13:19:19 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bc4d2e70518476f0a445761d43fee8b9e6670368
      https://github.com/llvm/llvm-project/commit/bc4d2e70518476f0a445761d43fee8b9e6670368
  Author: Konstantin Varlamov <varconst at apple.com>
  Date:   2022-07-20 (Wed, 20 Jul 2022)

  Changed paths:
    M libcxx/include/__algorithm/iterator_operations.h
    A libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort_proxy.pass.cpp

  Log Message:
  -----------
  [libc++] Fix `_IterOps::__iter_move` to support proxy iterators.

The return type was specified incorrectly for proxy iterators that
define `reference` to be a class that implicitly converts to
`value_type`. `__iter_move` would end up returning an object of type
`reference` which would then implicitly convert to `value_type`; thus,
the function will return a `value_type&&` rvalue reference to the local
temporary.

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




More information about the All-commits mailing list