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 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 // UNSUPPORTED: libcpp-no-concepts
11 // UNSUPPORTED: libcpp-has-no-incomplete-ranges
12 
13 // constexpr auto end()
14 //   requires (!simple-view<V>)
15 // constexpr auto end() const
16 //   requires range<const V>
17 
18 #include <ranges>
19 
20 #include "test_macros.h"
21 #include "types.h"
22 
23 constexpr bool test() {
24   // range<const V>
25   std::ranges::drop_view dropView1(MoveOnlyView(), 4);
26   assert(dropView1.end() == globalBuff + 8);
27 
28   // !simple-view<V>
29   std::ranges::drop_view dropView2(InputView(), 4);
30   assert(dropView2.end() == globalBuff + 8);
31 
32   // range<const V>
33   const std::ranges::drop_view dropView3(MoveOnlyView(), 0);
34   assert(dropView3.end() == globalBuff + 8);
35 
36   // !simple-view<V>
37   const std::ranges::drop_view dropView4(InputView(), 2);
38   assert(dropView4.end() == globalBuff + 8);
39 
40   // range<const V>
41   std::ranges::drop_view dropView5(MoveOnlyView(), 10);
42   assert(dropView5.end() == globalBuff + 8);
43 
44   return true;
45 }
46 
47 int main(int, char**) {
48   test();
49   static_assert(test());
50 
51   return 0;
52 }
53