Skip to content

Commit d0f79b4

Browse files
fix test when input is output range, which should fail
1 parent ee3479b commit d0f79b4

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,6 @@ constexpr bool test() {
6969
}
7070
}
7171

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-
7972
return true;
8073
}
8174

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
// REQUIRES: std-at-least-c++26
10+
11+
#include <cassert>
12+
#include <ranges>
13+
#include <vector>
14+
#include "test_macros.h"
15+
16+
int main(int, char**) {
17+
std::vector<int> v{1, 2, 3};
18+
auto r = std::views::counted(std::back_inserter(v), 3);
19+
auto c = std::views::concat(r);
20+
// expected-error@*:* {{}}
21+
22+
return 0;
23+
}

0 commit comments

Comments
 (0)