1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Usage of is_trivially_constructible is broken with these compilers.
11 // See https://llvm.org/bugs/show_bug.cgi?id=31016
12 // XFAIL: clang-3.7, apple-clang-7, apple-clang-7.0
16 // class istream_iterator
18 // constexpr istream_iterator();
19 // C++17 says: If is_trivially_default_constructible_v<T> is true, then this
20 // constructor shall beis a constexpr constructor.
26 #include "test_macros.h"
28 struct S { S(); }; // not constexpr
31 template <typename T, bool isTrivial = std::is_trivially_default_constructible_v<T>>
33 void operator ()() const {
34 constexpr std::istream_iterator<T> it;
39 struct test_trivial<T, false> {
40 void operator ()() const {}
48 typedef std::istream_iterator<int> T;
51 #if TEST_STD_VER >= 11
57 test_trivial<int>()();
58 test_trivial<char>()();
59 test_trivial<double>()();
61 test_trivial<std::string>()();