| 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 | // <iterator> |
| 10 | |
| 11 | // istreambuf_iterator |
| 12 | // |
| 13 | // istreambuf_iterator() noexcept; // constexpr since C++11 |
| 14 | // |
| 15 | // All specializations of istreambuf_iterator shall have a trivial copy constructor, |
| 16 | // a constexpr default constructor and a trivial destructor. |
| 17 | |
| 18 | #include <iterator> |
| 19 | #include <sstream> |
| 20 | #include <cassert> |
| 21 | |
| 22 | #include "test_macros.h" |
| 23 | |
| 24 | int main(int, char**) { |
| 25 | { |
| 26 | typedef std::istreambuf_iterator<char> T; |
| 27 | T it; |
| 28 | assert(it == T()); |
| 29 | #if TEST_STD_VER >= 11 |
| 30 | constexpr T it2; |
| 31 | (void)it2; |
| 32 | #endif |
| 33 | |
| 34 | ASSERT_NOEXCEPT(T()); |
| 35 | } |
| 36 | |
| 37 | #ifndef TEST_HAS_NO_WIDE_CHARACTERS |
| 38 | { |
| 39 | typedef std::istreambuf_iterator<wchar_t> T; |
| 40 | T it; |
| 41 | assert(it == T()); |
| 42 | #if TEST_STD_VER >= 11 |
| 43 | constexpr T it2; |
| 44 | (void)it2; |
| 45 | #endif |
| 46 | |
| 47 | ASSERT_NOEXCEPT(T()); |
| 48 | } |
| 49 | #endif // TEST_HAS_NO_WIDE_CHARACTERS |
| 50 | |
| 51 | return 0; |
| 52 | } |
| 53 | |