Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / iterators / predef.iterators / iterators.common / constraints.compile.pass.cpp
bloba18538c8f225c682a3342b2b0335d9a84a627b57
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 // template<input_or_output_iterator I, sentinel_for<I> S>
12 // requires (!same_as<I, S> && copyable<I>)
14 #include <iterator>
16 #include "test_iterators.h"
18 template<class I, class S>
19 concept ValidCommonIterator = requires {
20 typename std::common_iterator<I, S>;
23 static_assert( ValidCommonIterator<int*, const int*>);
24 static_assert(!ValidCommonIterator<int, int>); // !input_or_output_iterator<I>
25 static_assert(!ValidCommonIterator<int*, float*>); // !sentinel_for<S, I>
26 static_assert(!ValidCommonIterator<int*, int*>); // !same_as<I, S>
27 static_assert(!ValidCommonIterator<cpp20_input_iterator<int*>, sentinel_wrapper<cpp20_input_iterator<int*>>>); // !copyable<I>