<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59806>59806</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc++] `std::ranges::uninitialized_move` should use `std::iter_rvalue_reference_t` instead of `std::iter_reference_t` for the input iterator
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          toanth
      </td>
    </tr>
</table>

<pre>
    The following code fails to compile with _clang++ -std=c++20 -stdlib=libc++ -fexperimental-library_:
https://godbolt.org/z/7GszozP9q
The bug is present in libc++15 and the current trunk.

The reason is that in `ranges_uninitialized_algorithms.h`, the `requires` clause for the implementations of `std::ranges::uninitialized_move` and `std::ranges::uninitialized_move_n` use `iter_reference_t<_InputIterator>` instead of `iter_rvalue_reference_t<_InputIterator>` as mandated by the standard ($22.11.5):
https://github.com/llvm/llvm-project/blob/2671aa7e84367aae98cea8e37211b7afd31a20ce/libcxx/include/__memory/ranges_uninitialized_algorithms.h#L259

https://github.com/llvm/llvm-project/blob/2671aa7e84367aae98cea8e37211b7afd31a20ce/libcxx/include/__memory/ranges_uninitialized_algorithms.h#L295
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVE2TnDYQ_TU9F9VOidYAw4HDriekXJVDDrlTLWhAiZDGktivX58S4_XGSbliH30Cqfu9_lC_phjN7JhbKB-gvBxoS4sPbfLk0nLQfnxp_1hYTN5a_2TcLAY_spjI2CiSF4Nfr8ayeDJpEf1gyc2AD4AP4i6mEdRluB1R7hfWaFAXa_Tw5jXx85WDWdklsnfW6EDhpQd1D_IC8n5J6RrzCTvAbvaj9jYdfZgBu1fArv41vvrX35tPN_ecqt5mYaK4Bo7skjBOvMcrSkFuFGlhMWwhZHsKm_vreIO_kwSm6F3mSQvtJFDJQG7m2G_OOJMMWfPKY0929sGkZY3HBSoJ-GGnz-78aTOBI1RSDJa2mNsYdqtZr5b3mpPxLgo_ZcDesXtQ97dAt_-vo63-kTNfruL7Eb3LmJwAVNIkDn3giQO7gfsE6kP_0V239DFxoOQDqF-yu3ExMY2fc7uhHslu_D1gimIlN1LiUeiXveaY8kUYBeAZ8IR4LIpjCdh867FNWjZ9HPwK2Fn7-Pa5uwb_Jw8JsNPWa8AOq7ogqvl8UlVNxM15YDqzqrEodE3TqApCOXAmMHp4fgbsjBvsNuarvl959eEFsPv_B0b1G5bNP6flJ0m6KQ9jq8ZGNXTgtqhqrGtVFXhY2mIixaUiJeVU6aJWQzVyXdVFVermhM3BtChRyUKqokFZ4LFuqomJsJB01qwQTpJXMvaYS83qPJgYN27L5iyrgyXNNu4LBtHxk9iNgJj3TWj39uhtjnCS1sQU31mSSXbfTO8KhvLyg1KJi9_s-Db9X4DfGuj_TP6_EF-7fhF01oAwn0Vw2IJtf3gw9rZEwG5v298BAAD__1CY09U">