1560170faSzoecarver //===----------------------------------------------------------------------===//
2560170faSzoecarver //
3560170faSzoecarver // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4560170faSzoecarver // See https://llvm.org/LICENSE.txt for license information.
5560170faSzoecarver // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6560170faSzoecarver //
7560170faSzoecarver //===----------------------------------------------------------------------===//
8560170faSzoecarver 
9560170faSzoecarver // UNSUPPORTED: c++03, c++11, c++14, c++17
1071909de3SMark de Wever // UNSUPPORTED: libcpp-has-no-incomplete-ranges
11560170faSzoecarver 
12560170faSzoecarver // drop_view() requires default_initializable<V> = default;
13560170faSzoecarver 
14560170faSzoecarver #include <ranges>
15560170faSzoecarver 
16560170faSzoecarver #include "test_macros.h"
17560170faSzoecarver #include "types.h"
18560170faSzoecarver 
test()19560170faSzoecarver constexpr bool test() {
20610ac8dbSArthur O'Dwyer   std::ranges::drop_view<MoveOnlyView> dropView1;
21560170faSzoecarver   assert(std::ranges::begin(dropView1) == globalBuff);
22560170faSzoecarver 
23560170faSzoecarver   static_assert( std::is_default_constructible_v<std::ranges::drop_view<ForwardView>>);
24560170faSzoecarver   static_assert(!std::is_default_constructible_v<std::ranges::drop_view<NoDefaultCtorForwardView>>);
25560170faSzoecarver 
26*c93a531cSCasey Carter   LIBCPP_STATIC_ASSERT( std::is_nothrow_default_constructible_v<std::ranges::drop_view<ForwardView>>);
27560170faSzoecarver   static_assert(!std::is_nothrow_default_constructible_v<ThrowingDefaultCtorForwardView>);
28560170faSzoecarver   static_assert(!std::is_nothrow_default_constructible_v<std::ranges::drop_view<ThrowingDefaultCtorForwardView>>);
29560170faSzoecarver 
30560170faSzoecarver   return true;
31560170faSzoecarver }
32560170faSzoecarver 
main(int,char **)33560170faSzoecarver int main(int, char**) {
34560170faSzoecarver   test();
35560170faSzoecarver   static_assert(test());
36560170faSzoecarver 
37560170faSzoecarver   return 0;
38560170faSzoecarver }
39