<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Invalid test for views::view_interface"
href="https://bugs.llvm.org/show_bug.cgi?id=50720">50720</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Invalid test for views::view_interface
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>12.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zilla@kayari.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>The test std/ranges/range.utility/view.interface/view.interface.pass.cpp uses
this type:
struct MoveOnlyForwardRange : std::ranges::view_interface<MoveOnlyForwardRange>
{
int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7};
MoveOnlyForwardRange(MoveOnlyForwardRange const&) = delete;
MoveOnlyForwardRange(MoveOnlyForwardRange &&) = default;
MoveOnlyForwardRange() = default;
This violates the precondition for the view_interface base class, because the
type is not assignable so fails to satisfy std::movable, which is required by
the std::ranges::view concept.
You need:
---
a/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
+++
b/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
@@ -77,6 +77,7 @@ struct MoveOnlyForwardRange :
std::ranges::view_interface<MoveOnlyForwardRange>
int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7};
MoveOnlyForwardRange(MoveOnlyForwardRange const&) = delete;
MoveOnlyForwardRange(MoveOnlyForwardRange &&) = default;
+ MoveOnlyForwardRange& operator=(MoveOnlyForwardRange &&) = default;
MoveOnlyForwardRange() = default;
constexpr ForwardIter begin() const { return
ForwardIter(const_cast<int*>(buff)); }
constexpr ForwardIter end() const { return
ForwardIter(const_cast<int*>(buff) + 8); }
Also, your tests seem to be compiled with -Wshadow which causes a failure when
using GCC, because of this type in the test:
struct SentinelType {
int *base;
SentinelType() = default;
explicit constexpr SentinelType(int *base) : base(base) {}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>