Revert "P0503R0, adopted in Issaquah, rewords some requirements on nullptr_t and istream_iterator. No code changes were needed, but I updated a few tests. Also resolved P0509 and P0521, which required no changes to the library or tests."

This reverts commit r286884, because it breaks the Xcode 7 builders:

  http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/1583

Here is a PR that tracks the issue:
https://llvm.org/bugs/show_bug.cgi?id=31016

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287004 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vedant Kumar 2016-11-15 18:48:36 +00:00
parent dd8b03ec4c
commit e3cb222597
4 changed files with 6 additions and 46 deletions

View File

@ -12,15 +12,11 @@
// class istream_iterator
// istream_iterator(const istream_iterator& x);
// C++17 says: If is_trivially_copy_constructible_v<T> is true, then
// this constructor shall beis a trivial copy constructor.
#include <iterator>
#include <sstream>
#include <cassert>
#include "test_macros.h"
int main()
{
{

View File

@ -12,32 +12,12 @@
// class istream_iterator
// constexpr istream_iterator();
// C++17 says: If is_trivially_default_constructible_v<T> is true, then this
// constructor shall beis a constexpr constructor.
#include <iterator>
#include <cassert>
#include <string>
#include "test_macros.h"
struct S { S(); }; // not constexpr
#if TEST_STD_VER > 14
template <typename T, bool isTrivial = std::is_trivially_default_constructible_v<T>>
struct test_trivial {
void operator ()() const {
constexpr std::istream_iterator<T> it;
}
};
template <typename T>
struct test_trivial<T, false> {
void operator ()() const {}
};
#endif
int main()
{
{
@ -49,11 +29,4 @@ int main()
#endif
}
#if TEST_STD_VER > 14
test_trivial<int>()();
test_trivial<char>()();
test_trivial<double>()();
test_trivial<S>()();
test_trivial<std::string>()();
#endif
}

View File

@ -23,18 +23,9 @@
// typedef basic_istream<charT,traits> 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<T> is true, then
// this constructor (the default ctor) shall beis a constexpr constructor.
// If is_trivially_copy_constructible_v<T> is true, then
// this constructor (the copy ctor) shall beis a trivial copy constructor.
// If is_trivially_destructible_v<T> is true, then this
// destructor shall beis a trivial destructor.
// Testing the C++17 ctors for this are in the ctor tests.
#include <iterator>
#include <type_traits>
@ -42,7 +33,7 @@
int main()
{
typedef std::istream_iterator<double> I1; // double is trivially destructible
typedef std::istream_iterator<double> I1;
static_assert((std::is_convertible<I1,
std::iterator<std::input_iterator_tag, double, std::ptrdiff_t,
const double*, const double&> >::value), "");
@ -52,7 +43,7 @@ int main()
static_assert( std::is_trivially_copy_constructible<I1>::value, "");
static_assert( std::is_trivially_destructible<I1>::value, "");
typedef std::istream_iterator<unsigned, wchar_t> I2; // unsigned is trivially destructible
typedef std::istream_iterator<unsigned, wchar_t> I2;
static_assert((std::is_convertible<I2,
std::iterator<std::input_iterator_tag, unsigned, std::ptrdiff_t,
const unsigned*, const unsigned&> >::value), "");
@ -62,7 +53,7 @@ int main()
static_assert( std::is_trivially_copy_constructible<I2>::value, "");
static_assert( std::is_trivially_destructible<I2>::value, "");
typedef std::istream_iterator<std::string> I3; // string is NOT trivially destructible
typedef std::istream_iterator<std::string> I3;
static_assert(!std::is_trivially_copy_constructible<I3>::value, "");
static_assert(!std::is_trivially_destructible<I3>::value, "");
}

View File

@ -130,16 +130,16 @@
<tr><td><a href="http://wg21.link/P0426R1">P0426R1</a></td><td>LWG</td><td>Constexpr for <tt>std::char_traits</tt></td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0435R1">P0435R1</a></td><td>LWG</td><td>Resolving LWG Issues re <tt>common_type</tt></td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0502R0">P0502R0</a></td><td>LWG</td><td>Throwing out of a parallel algorithm terminates - but how?</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0503R0">P0503R0</a></td><td>LWG</td><td>Correcting library usage of "literal type"</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/P0503R0">P0503R0</a></td><td>LWG</td><td>Correcting library usage of "literal type"</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0504R0">P0504R0</a></td><td>LWG</td><td>Revisiting in-place tag types for any/optional/variant</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0505R0">P0505R0</a></td><td>LWG</td><td>Wording for GB 50 - constexpr for chrono</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0508R0">P0508R0</a></td><td>LWG</td><td>Wording for GB 58 - structured bindings for node_handles</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0509R1">P0509R1</a></td><td>LWG</td><td>Updating “Restrictions on exception handling”</td><td>Issaquah</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
<tr><td><a href="http://wg21.link/P0509R1">P0509R1</a></td><td>LWG</td><td>Updating “Restrictions on exception handling”</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0510R0">P0510R0</a></td><td>LWG</td><td>Disallowing references, incomplete types, arrays, and empty variants</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0513R0">P0513R0</a></td><td>LWG</td><td>Poisoning the Hash</td><td>Issaquah</td><td></td><td></td></tr>
<tr><td><a href="http://wg21.link/P0516R0">P0516R0</a></td><td>LWG</td><td>Clarify That shared_futures Copy Operations have Wide Contracts</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/P0517R0">P0517R0</a></td><td>LWG</td><td>Make future_error Constructible</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
<tr><td><a href="http://wg21.link/P0521R0">P0521R0</a></td><td>LWG</td><td>Proposed Resolution for CA 14 (shared_ptr use_count/unique)</td><td>Issaquah</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
<tr><td><a href="http://wg21.link/P0521R0">P0521R0</a></td><td>LWG</td><td>Proposed Resolution for CA 14 (shared_ptr use_count/unique)</td><td>Issaquah</td><td></td><td></td></tr>
<!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
</table>