//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // Usage of is_trivially_constructible is broken with these compilers. // See https://llvm.org/bugs/show_bug.cgi?id=31016 // XFAIL: clang-3.7, apple-clang-7, apple-clang-7.0 // // class istream_iterator // constexpr istream_iterator(); // C++17 says: If is_trivially_default_constructible_v is true, then this // constructor shall beis a constexpr constructor. #include #include #include #include "test_macros.h" struct S { S(); }; // not constexpr #if TEST_STD_VER > 14 template > struct test_trivial { void operator ()() const { constexpr std::istream_iterator it; } }; template struct test_trivial { void operator ()() const {} }; #endif int main() { { typedef std::istream_iterator T; T it; assert(it == T()); #if TEST_STD_VER >= 11 constexpr T it2; #endif } #if TEST_STD_VER > 14 test_trivial()(); test_trivial()(); test_trivial()(); test_trivial()(); test_trivial()(); #endif }