diff --git a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/copy.pass.cpp b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/copy.pass.cpp index 0d70c7fc9..7f807b63e 100644 --- a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/copy.pass.cpp +++ b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/copy.pass.cpp @@ -12,11 +12,15 @@ // class istream_iterator // istream_iterator(const istream_iterator& x); +// C++17 says: If is_trivially_copy_constructible_v is true, then +// this constructor shall beis a trivial copy constructor. #include #include #include +#include "test_macros.h" + int main() { { diff --git a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp index c1924e4b9..745b08cbd 100644 --- a/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp +++ b/test/std/iterators/stream.iterators/istream.iterator/istream.iterator.cons/default.pass.cpp @@ -7,17 +7,41 @@ // //===----------------------------------------------------------------------===// +// Usage of is_trivially_constructible is broken with these compilers. +// See https://llvm.org/bugs/show_bug.cgi?id=31016 +// XFAIL: clang-3.7 + // // 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() { { @@ -29,4 +53,11 @@ int main() #endif } +#if TEST_STD_VER > 14 + test_trivial()(); + test_trivial()(); + test_trivial()(); + test_trivial()(); + test_trivial()(); +#endif } diff --git a/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp b/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp index 1250e364d..b1bf75b11 100644 --- a/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp +++ b/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp @@ -23,9 +23,18 @@ // typedef basic_istream istream_type; // ... // +// Before C++17, we have: // If T is a literal type, then the default constructor shall be a constexpr constructor. // If T is a literal type, then this constructor shall be a trivial copy constructor. // If T is a literal type, then this destructor shall be a trivial destructor. +// C++17 says: +// If is_trivially_default_constructible_v is true, then +// this constructor (the default ctor) shall beis a constexpr constructor. +// If is_trivially_copy_constructible_v is true, then +// this constructor (the copy ctor) shall beis a trivial copy constructor. +// If is_trivially_destructible_v is true, then this +// destructor shall beis a trivial destructor. +// Testing the C++17 ctors for this are in the ctor tests. #include #include @@ -33,7 +42,7 @@ int main() { - typedef std::istream_iterator I1; + typedef std::istream_iterator I1; // double is trivially destructible static_assert((std::is_convertible >::value), ""); @@ -43,7 +52,7 @@ int main() static_assert( std::is_trivially_copy_constructible::value, ""); static_assert( std::is_trivially_destructible::value, ""); - typedef std::istream_iterator I2; + typedef std::istream_iterator I2; // unsigned is trivially destructible static_assert((std::is_convertible >::value), ""); @@ -53,7 +62,7 @@ int main() static_assert( std::is_trivially_copy_constructible::value, ""); static_assert( std::is_trivially_destructible::value, ""); - typedef std::istream_iterator I3; + typedef std::istream_iterator I3; // string is NOT trivially destructible static_assert(!std::is_trivially_copy_constructible::value, ""); static_assert(!std::is_trivially_destructible::value, ""); } diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html index 6a066a869..bbdfff648 100644 --- a/www/cxx1z_status.html +++ b/www/cxx1z_status.html @@ -130,16 +130,16 @@ P0426R1LWGConstexpr for std::char_traitsIssaquah P0435R1LWGResolving LWG Issues re common_typeIssaquah P0502R0LWGThrowing out of a parallel algorithm terminates - but how?Issaquah - P0503R0LWGCorrecting library usage of "literal type"Issaquah + P0503R0LWGCorrecting library usage of "literal type"IssaquahComplete4.0 P0504R0LWGRevisiting in-place tag types for any/optional/variantIssaquahComplete4.0 P0505R0LWGWording for GB 50 - constexpr for chronoIssaquah P0508R0LWGWording for GB 58 - structured bindings for node_handlesIssaquah - P0509R1LWGUpdating “Restrictions on exception handling”Issaquah + P0509R1LWGUpdating “Restrictions on exception handling”IssaquahNothing to don/a P0510R0LWGDisallowing references, incomplete types, arrays, and empty variantsIssaquahComplete4.0 P0513R0LWGPoisoning the HashIssaquah P0516R0LWGClarify That shared_future’s Copy Operations have Wide ContractsIssaquahComplete4.0 P0517R0LWGMake future_error ConstructibleIssaquahComplete4.0 - P0521R0LWGProposed Resolution for CA 14 (shared_ptr use_count/unique)Issaquah + P0521R0LWGProposed Resolution for CA 14 (shared_ptr use_count/unique)IssaquahNothing to don/a