Commit Graph

576 Commits

Author SHA1 Message Date
Eric Fiselier
a4fd0c9d61 Overhaul unique_ptr - Implement LWG 2801, 2905, 2520.
This patch overhauls both specializations of unique_ptr while implementing
the following LWG issues:

* LWG 2801 - This issue constrains unique_ptr's constructors when the deleter type
  is not default constructible. Additionally it adds SFINAE conditions
  to unique_ptr<T[]>::unique_ptr(Up).

* LWG 2905 - This issue reworks the unique_ptr(pointer, /* see below */ deleter)
  constructors so that they correctly SFINAE when the deleter argument cannot
  be used to construct the stored deleter.

* LWG 2520 - This issue fixes initializing unique_ptr<T[]> from nullptr.
  Libc++ had previously implemented this issue, but the suggested resolution
  still broke initialization from NULL. This patch re-works the
  unique_ptr<T[]>(Up, deleter) overloads so that they accept NULL as well
  as nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 01:51:04 +00:00
Eric Fiselier
98d9a858da Implement LWG 2857 for variant. Tests from Casey Carter @ Microsoft.
Also mark LWG 2857 as complete, since the changes to optional and
any were completed by Marshall earlier.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300403 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-15 19:32:02 +00:00
Marshall Clow
6403571b40 Implement LWG#2855 - made easy by previous refactoring
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300218 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 16:57:42 +00:00
Eric Fiselier
7b41c797ba [libc++] Implement LWG 2911 - add an is_aggregate type-trait
Summary:
This patch implements http://cplusplus.github.io/LWG/lwg-defects.html#2911.

I'm putting this up for review until __is_aggregate is added to clang (See D31513)

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D31515

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300126 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 23:08:46 +00:00
Marshall Clow
01208afbd6 Implement LWG#2873: 'Add noexcept to several shared_ptr related functions' This issue missed a couple, so I added those as well (see LWG#2942)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@299963 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 17:08:53 +00:00
Marshall Clow
41324261fa Mark P0599 as complete. It was implemented in r298573
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@299941 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 14:04:03 +00:00
Eric Fiselier
2b3c1c4d9b Fix LWG 2934 - optional<const T> doesn't compare with T
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@299105 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 20:06:52 +00:00
Eric Fiselier
5612bd42dc Implement LWG 2842 - optional(U&&) needs to SFINAE on decay_t<in_place_t>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@299100 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 19:43:50 +00:00
Marshall Clow
21ae16e203 Implement P0298R3: 'std::byte'. Reviewed as https://reviews.llvm.org/D31022
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298689 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 05:45:39 +00:00
Marshall Clow
59bcc879ab Implement Pp0156r2: 'Variadic Lock Guard, version 5' Reviewed as https://reviews.llvm.org/D31163.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298681 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 03:40:36 +00:00
Marshall Clow
cf6e0db0b9 Implement P0548: 'common_type and duration' This involves a subtle change in the return type of the unary +/- operators for std::chrono::duration, though I expect that no one will notice.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298416 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 18:38:57 +00:00
Marshall Clow
0b1f95bb0d Add two more papers from Kona, and sort them
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-20 18:18:09 +00:00
Marshall Clow
2d4c3fa48a Implement LWG#2761: 'basic_string should require that charT match traits::char_type'. Tests for string_view, too
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 18:41:11 +00:00
Marshall Clow
7a16fa8ae2 Mark LWG issues 2868, 2872, and 2890 as complete. There's nothing we need to do for them.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297758 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-14 17:35:56 +00:00
Marshall Clow
755dd5959c Also mark LWG#2785 as complete, because we already implemented that
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297753 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-14 17:24:29 +00:00
Marshall Clow
abba685fcd Implement LWG2784, and mark 2786, 2795, 2804, 2812, 2826, 2834, 2837 and 2838 as complete - since we do them already
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297752 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-14 17:08:47 +00:00
Eric Fiselier
f158316563 Mark LWG 2806 as complete. Libc++ speculatively shiped this change in 4.0
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297074 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 21:09:02 +00:00
Eric Fiselier
27d4f668b3 Mark LWG 2789 as complete. No changes required
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297073 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 21:07:18 +00:00
Eric Fiselier
7c7df6461c Implement LWG 2787 - [file_status.cons] is inconsistent
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297071 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 21:02:06 +00:00
Eric Fiselier
b537d38bb2 Mark LWG 2781 as complete. No changes required
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 20:56:13 +00:00
Eric Fiselier
76a3c66153 Mark two any_cast issues as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297066 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 20:49:42 +00:00
Marshall Clow
cd6055e526 Header update with info about the current status of C++17
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297022 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 16:09:02 +00:00
Marshall Clow
e116393a06 Update list with changes from Kona meeting
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297021 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-06 16:06:02 +00:00
Eric Fiselier
b7fd0be370 Update all bug URL's to point to https://bugs.llvm.org/...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 08:37:03 +00:00
Eric Fiselier
515ba559b9 [libcxx] Remove unexpected handlers in C++17
Summary:
This patch implements [P0003R5](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html) which removes exception specifications from C++17.

The only changes to the library are removing `set_unexpected`, `get_unexpected`, `unexpected`, and `unexpected_handler`. These functions can be re-enabled in C++17 using `_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS`.

@mclow.lists what do you think about removing stuff is this way?

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: mclow.lists, cfe-commits

Differential Revision: https://reviews.llvm.org/D28172

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 03:25:08 +00:00
Marshall Clow
d5854559eb Update a couple of issue statuses
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295355 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 18:50:30 +00:00
Eric Fiselier
59955033d2 Update info for LWG 2665 in upcoming_meeting.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294501 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 19:04:18 +00:00
Marshall Clow
542c6e8f9b Mark LWG2784 as ready
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294311 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 15:34:20 +00:00
Marshall Clow
24597f254d Add some tests to verify that we implement LWG#2837 correctly. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294194 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 16:03:23 +00:00
Marshall Clow
c3eec461e7 Fix a typo - extra '>'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294190 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 15:29:03 +00:00
Marshall Clow
5a00ab8ea7 Set up 'upcoming meeting' bug list
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294189 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 15:17:22 +00:00
Eric Fiselier
a67aa062c6 Mark LWG 2765 as complete. No changes needed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294167 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 02:41:49 +00:00
Eric Fiselier
07d23d5d93 Implement LWG 2773 - std::ignore should be constexpr.
In addition to the PR for LWG 2773 this patch also ensures
that each of std::ignores constructors or assignment operators
are constexpr.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294165 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 01:25:31 +00:00
Marshall Clow
da709135c5 Fixed a couple of invalid statuses for 2665 and 2758
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293179 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26 14:36:14 +00:00
Marshall Clow
9bb0cca646 Implement LWG2556: Wide contract for future::share()
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292992 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 23:28:25 +00:00
Marshall Clow
4e42dc97f3 Change the return type of emplace_[front|back] back to void when building with C++14 or before. Resolves PR31680.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292990 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 23:09:12 +00:00
Marshall Clow
9a89d24bb0 Update status for LWG2733
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 19:37:09 +00:00
Marshall Clow
a5f53d0730 Mark LWG2736 as complete. No code changes, but we have more tests now
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292958 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 18:03:32 +00:00
Marshall Clow
fbe68a68ab Implement LWG#2778: basic_string_view is missing constexpr.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292823 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 19:53:28 +00:00
Eric Fiselier
952eaecfc6 Implement P0513R0 - "Poisoning the Hash"
Summary:
Exactly what the title says.

This patch also adds a `std::hash<nullptr_t>` specialization in C++17, but it was not added by this paper and I can't find the actual paper that adds it.

See http://wg21.link/P0513R0 for more info.

If there are no comments in the next couple of days I'll commit this

Reviewers: mclow.lists, K-ballo, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D28938

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292684 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-21 00:02:12 +00:00
Marshall Clow
56257d4918 Mark two of the TS implementations as 'in progress'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292490 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19 15:30:36 +00:00
Marshall Clow
8d2a5ad70b Mark 'constexpr char_traits' as complete.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292000 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 05:55:17 +00:00
Marshall Clow
7d32d2f5a1 Implement P0403R1 - 'Literal suffixes for basic_string_view'. Requires clang 4.0 (specifically, r290744)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 18:07:34 +00:00
Marshall Clow
3df90c94a3 Implement P0505: 'Wording for GB 50'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291028 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 23:03:24 +00:00
Marshall Clow
e22af6b758 Implement the last bit of P0031: 'A Proposal to Add Constexpr Modifiers to reverse_iterator, move_iterator, array and Range Access' for C++17
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290976 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 17:58:17 +00:00
Eric Fiselier
d28b523b58 Update year to 2017
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03 11:20:43 +00:00
Eric Fiselier
9f988e6e4e Update "Making Optional Greater Equal Again" paper status
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 04:16:30 +00:00
Eric Fiselier
01eb99ac7b Implement a throwing version of _LIBCPP_ASSERT.
This patch implements changes to allow _LIBCPP_ASSERT to throw on failure
instead of aborting. The main changes needed to do this are:

1. Change _LIBCPP_ASSERT to call a handler via a replacable function pointer
   instead of calling abort directly. Additionally this patch implements two
   handler functions, one which aborts and another that throws an exception.

2. Add _NOEXCEPT_DEBUG macro for disabling noexcept spec on function which
   contain _LIBCPP_ASSERT. This is required in order to prevent assertion
   failures throwing through a noexcept function. This macro has no effect
   unless _LIBCPP_DEBUG_USE_EXCEPTIONS is defined.

Having a non-aborting _LIBCPP_ASSERT is very important to allow sane testing of
debug mode. Currently we can only have one test case per file, since the test
case will cause the program to abort. Testing debug mode this way would require
thousands of test files, most of which would be 95% boiler plate. I don't think
this is a feasible strategy. Fortunately using a throwing debug handler solves
these issues.

Additionally this patch rewrites the documentation for debug mode.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290651 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-28 04:58:52 +00:00
Eric Fiselier
046a71be67 Implement P0435R1 - Resolving LWG issues for common_type
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-27 21:16:48 +00:00
Eric Fiselier
6d95982406 Recommit r286884: 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 patch was reverted due to llvm.org/PR31016. There is a bug in Clang 3.7
which causes default.pass.cpp to fails. That test is now marked as XFAIL for that
clang version.

This patch was originally authored by Marshall Clow.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 21:22:48 +00:00