[libcxx-commits] [PATCH] D141699: [libc++][ranges] Implement P2474R2(`views::repeat`).

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 21 09:19:55 PST 2023


Mordante added a comment.

In D141699#4139140 <https://reviews.llvm.org/D141699#4139140>, @yronglin wrote:

> Seems this is an issue in older version clang(https://godbolt.org/z/PsqzMq3q8), should we disable this test in older version clang or use other workarounds, WDYT? @Mordante 
> @philnik
>
>   struct A {
>     int x_;
>     int y_;
>   };
>   
>   constexpr bool test() {
>     std::ranges::repeat_view<A, int> rv(std::piecewise_construct, std::tuple{1, 2}, std::tuple{3});
>     assert(rv.size() == 3);
>     assert(rv[0].x_ == 1);
>     assert(rv[0].y_ == 2);
>     assert(std::ranges::next(rv.begin(), 3) == rv.end());
>   
>     return true;
>   }

I haven't looked closely at the error, but might it be that this code requires P0960? That paper was implemented in Clang 16.

Disabling the test due to lack of compiler support is acceptable. When it's possible to introduce a work-around for Clang 15 that would be preferred.

[P0960] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0960r3.html


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141699/new/

https://reviews.llvm.org/D141699



More information about the libcxx-commits mailing list