Skip to content

Commit 30e9ba4

Browse files
add test which should fail as a single input to concat_view
1 parent 102e4a9 commit 30e9ba4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libcxx/test/std/ranges/range.adaptors/range.concat/ctor.default.pass.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#include <cassert>
1414
#include <type_traits>
15+
#include <vector>
16+
#include "check_assertion.h"
1517

1618
constexpr int buff[] = {1, 2, 3, 4};
1719

@@ -67,6 +69,13 @@ constexpr bool test() {
6769
}
6870
}
6971

72+
// check when input is an output range, which should be well-formed
73+
{
74+
std::vector<int> v{1,2,3};
75+
auto r = std::views::counted(std::back_inserter(v), 3);
76+
static_assert(!std::ranges::input_range<decltype(r)>);
77+
}
78+
7079
return true;
7180
}
7281

0 commit comments

Comments
 (0)