Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / iterators / predef.iterators / counted.iterator / ctor.default.pass.cpp
blob60596ad43c602a6d9762bfe305677c92afb3fcf7
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 // constexpr counted_iterator() requires default_initializable<I> = default;
13 #include <iterator>
15 #include "test_macros.h"
16 #include "test_iterators.h"
18 constexpr bool test() {
19 static_assert(!std::default_initializable<std::counted_iterator<cpp17_input_iterator<int*>>>);
20 static_assert( std::default_initializable<std::counted_iterator<forward_iterator<int*>>>);
22 std::counted_iterator<forward_iterator<int*>> iter;
23 assert(iter.base() == forward_iterator<int*>());
24 assert(iter.count() == 0);
26 return true;
29 int main(int, char**) {
30 test();
31 static_assert(test());
33 return 0;