diff --git a/libcxx/docs/Status/Cxx2cIssues.csv b/libcxx/docs/Status/Cxx2cIssues.csv index 082a86a65c852..a7a76cff8c68d 100644 --- a/libcxx/docs/Status/Cxx2cIssues.csv +++ b/libcxx/docs/Status/Cxx2cIssues.csv @@ -70,7 +70,7 @@ "`LWG4076 `__","``concat_view`` should be freestanding","2024-06 (St. Louis)","","","" "`LWG4079 `__","Missing Preconditions in ``concat_view::iterator``\`s conversion constructor","2024-06 (St. Louis)","","","" "`LWG4082 `__","``views::concat(r)`` is well-formed when ``r`` is an ``output_range``","2024-06 (St. Louis)","","","" -"`LWG4083 `__","``views::as_rvalue`` should reject non-input ranges","2024-06 (St. Louis)","","","" +"`LWG4083 `__","``views::as_rvalue`` should reject non-input ranges","2024-06 (St. Louis)","|Complete|","22","" "`LWG4096 `__","``views::iota(views::iota(0))`` should be rejected","2024-06 (St. Louis)","|Complete|","22","" "`LWG4098 `__","``views::adjacent<0>`` should reject non-forward ranges","2024-06 (St. Louis)","","","" "`LWG4105 `__","``ranges::ends_with``\`s Returns misses difference casting","2024-06 (St. Louis)","","","" diff --git a/libcxx/include/__ranges/as_rvalue_view.h b/libcxx/include/__ranges/as_rvalue_view.h index 5849a6c368396..08acf3d7736c6 100644 --- a/libcxx/include/__ranges/as_rvalue_view.h +++ b/libcxx/include/__ranges/as_rvalue_view.h @@ -117,7 +117,7 @@ struct __fn : __range_adaptor_closure<__fn> { return /*---------------------------------*/ as_rvalue_view(std::forward<_Range>(__range)); } - template + template requires same_as, range_reference_t<_Range>> [[nodiscard]] _LIBCPP_HIDE_FROM_ABI static constexpr auto operator()(_Range&& __range) noexcept(noexcept(views::all(std::forward<_Range>(__range)))) diff --git a/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/adaptor.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/adaptor.pass.cpp index dbe15238ebc86..88b28b0ec9832 100644 --- a/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/adaptor.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.as.rvalue/adaptor.pass.cpp @@ -48,6 +48,16 @@ struct move_iterator_range { static_assert(!std::ranges::view); static_assert(std::ranges::range); +// LWG4083: views::as_rvalue should reject non-input ranges +struct I { + int operator*(); + using difference_type = int; + I& operator++(); + void operator++(int); +}; +static_assert( + !HasPipe); + constexpr bool test() { { // view | views::as_rvalue DefaultConstructibleView v{{}, 3};