Commit Graph

2806 Commits

Author SHA1 Message Date
Eric Fiselier
103f80d818 Remove accidental change committed in r274403.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 23:31:55 +00:00
Eric Fiselier
e8b134c1bc Turn off ASAN's odr-violation diagnostics for now. See PR28391
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274404 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 23:25:47 +00:00
Eric Fiselier
1eb8739a33 Work around ABI break caused by C++17 inline variables.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 23:22:25 +00:00
Eric Fiselier
ed33ed8023 Flatten tuple_constructible, tuple_convertible and tuple_assignable.
This patch is the last in a series that replaces recursive meta-programming
in std::tuple with non-recursive implementations.

Previously std::tuple could only be instantiated with 126 elements before
it blew the max template instantiation depth. Now the size of std::tuple is
essentially unbounded (I've tested with over 5000 elements).

One unfortunate side-effect of this change is that tuple_constructible
and similar no longer short circuit after the first failure. Instead they
evaluate the conditions for all elements. This could be potentially breaking.
I plan to look into this further.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 04:07:39 +00:00
Eric Fiselier
053859ffc6 Flatten the tuple_element and __make_tuple_types implementations.
This patch attempts to improve the QoI of std::tuples tuple_element and
__make_tuple_types helpers. Previously they required O(N) instantiations,
one for every element in the tuple

The new implementations are O(1) after __tuple_indices<Id...> is created.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-01 03:54:54 +00:00
Eric Fiselier
a3ccd96ede Replace __make_tuple_indices implementation with superior implementation.
The previous __make_tuple_indices implementation caused O(N) instantiations
and was pretty inefficient. The C++14 __make_integer_sequence implementation
is much better, since it either uses a builtin to generate the sequence or
a very nice Log8(N) implementation provided by richard smith.

This patch moves the __make_integer_sequence implementation into __tuple
and uses it to implement __make_tuple_indices.

Since libc++ can't expose the name 'integer_sequence' in C++11 this patch
also introduces a dummy type '__integer_sequence' which is used when generating
the sequence. One the sequence is generated '__integer_sequence' can be
converted into the required type; either '__tuple_indices' or 'integer_sequence'.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 22:34:43 +00:00
Marshall Clow
1a93312404 Fix static assert problem on gcc; remove XFAILs that I put in in r274250
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 22:05:45 +00:00
Eric Fiselier
3efb2c901e Fix C++03 build.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 20:46:58 +00:00
Marshall Clow
dd18d90adf Mark issues 2550, 2551, 2555, 2685, 2698 as complete. These issues are wording clarifications; no code changes required.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 18:05:19 +00:00
Marshall Clow
d94c7765c6 Mark issues 2667, 2669, 2670, 2671, 2673 as complete. These issues are wording clarifications; no code changes required.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274253 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 17:59:01 +00:00
Marshall Clow
0b02cf8cf1 Implement LWG#2688: 'clamp misses preconditions and has extraneous condition on result'. We already did this, just added tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 17:52:51 +00:00
Marshall Clow
a0f496b989 Temporarily XFAIL the incomplete type tests for GCC while I figure out why adding a static_assert in r274235 broken them
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274250 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 17:49:36 +00:00
Marshall Clow
256814f751 Implement LWG#2684: 'priority_queue lacking comparator typedef'. We already did this, just added tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 16:03:50 +00:00
Marshall Clow
f0419f1dcc Implement LWG#2596: 'vector::data() should use addressof'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 15:50:55 +00:00
Marshall Clow
ca894508f9 Implement LWG#2441: 'Exact-width atomic typedefs should be provided'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 15:28:38 +00:00
Marshall Clow
0c99f18af4 Implement LWG#2436: 'Comparators for associative containers should always be CopyConstructible'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274235 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 15:11:53 +00:00
Eric Fiselier
3e9545e035 Update status of already completed Oulu issues.
* P0163r0: Implemented in r273839.

* LWG 2309: pthread_mutex_lock only returns this error if certain debug flags
  were passed during construction. libc++ does not pass these flags. There is
  nothing to do.

* LWG 2310: Wording fix. No impact on libc++'s implementation.

* LWG 2312: libc++'s std::tuple implementation already constrains the overloads
  based on the number of arguments.

* LWG 2549: libc++'s std::tuple already applied this fix.

* LWG 2674: libc++ already depends on this relaxed wording.

* LWG 2704, 2706, 2707, 2719, 2720, 2721, 2723, 2725, 2728: All of these filesystem were either
  submitted by me and fixed before submission, or have already been applied.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 06:59:29 +00:00
Eric Fiselier
b0ee61352f Make futures.overview enum tests more portable. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 05:00:32 +00:00
Eric Fiselier
0fc5603d78 Make std::array typedef tests more portable.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274210 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:54:00 +00:00
Eric Fiselier
c848cefa27 Fix ::reference typedef in insert iterators.
Since at least the C++11 standard insert iterators are specified
as having ::reference typedef void. Libc++ was not doing that.
This patch corrects the typedef.

This patch changes the std::iterator base class of insert_iterator,
front_insert_iterator and back_insert_iterator. This should not
be an ABI breaking change.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:40:50 +00:00
Eric Fiselier
8db06d71c2 Make instreambuf.iterator/types.pass.cpp more portable.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274207 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:31:09 +00:00
Eric Fiselier
68d0f230e9 Fix use of terse static assert. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:29:12 +00:00
Eric Fiselier
16715b9a88 Fix unary_function inheritance assumption. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274205 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:28:12 +00:00
Eric Fiselier
eb4c5e90a7 Fix unreferenced parameter warning. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:22:58 +00:00
Eric Fiselier
3a60979362 Avoid applying unary minus to unsigned integers. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274203 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 04:21:52 +00:00
Akira Hatanaka
70bf1c2280 [libcxx] Fix a bug in strstreambuf::overflow.
The end pointer should point to one past the end of the newly allocated
buffer.

rdar://problem/24265174

Differential Revision: http://reviews.llvm.org/D20334


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274132 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 15:26:13 +00:00
Marshall Clow
05d5c05fe8 Use WG21.link reflector to get to issues, rather than linking directly
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 14:13:28 +00:00
Marshall Clow
01ac037a5b Updated C++1Z status page with new work from Oulu WG21 meeting
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-28 14:11:54 +00:00
Marshall Clow
871506f9c2 Fix bad link for P0006
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 11:14:34 +00:00
Eric Fiselier
928a58f7d2 Fix UB in uses_alloc_types.hpp
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 01:52:14 +00:00
Eric Fiselier
83d7ca9ea5 Implement P0163r0. Add shared_ptr::weak_type.
This patch adds the weak_type typedef in shared_ptr. It is available in
C++17 and newer.

This patch also updates the _LIBCPP_STD_VER and TEST_STD_VER macros to
have the value of 16, since 2016 is the current year.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 01:02:43 +00:00
Eric Fiselier
5781358757 Implement p0337r0. Delete operator= for polymorphic_allocator.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273838 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 00:55:25 +00:00
Eric Fiselier
715ca51666 Implement P0358r1. Fixes for not_fn.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 00:40:41 +00:00
Eric Fiselier
c297a25c55 Fix C++03 failure in enable_shared_from_this test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 00:38:28 +00:00
Eric Fiselier
7838768593 Fix PR27115 - enable_shared_from_this does not work as a virtual base class.
See https://llvm.org/bugs/show_bug.cgi?id=27115

The problem was that the conversion from
'const enable_shared_from_this<T>*' to 'const T*' didn't work if
T inherited enable_shared_from_this as a virtual base class. The fix
is to take the original pointer passed to shared_ptr's constructor in the
__enable_weak_this method and perform an upcast to 'const T*' instead of
performing a downcast from the enable_shared_from_this base.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273835 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 23:56:32 +00:00
Eric Fiselier
7a317cec51 Fix C++03 build
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 23:18:23 +00:00
Eric Fiselier
e7aabbb6c6 Fix PR28079 - std::wstring_convert move constructor broken.
The move constructor for wstring_convert accidentally copied the state member
into the converted count member in the move constructor. This patch fixes
the typo.

While working on this I discovered that wstring_convert doesn't actually
provide a move constructor according to the standard and therefore this
constructor is a libc++ extension. I'll look further into whether libc++ should
provide this constructor at all. Neither libstdc++ or MSVC's STL provide it.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 22:56:26 +00:00
Eric Fiselier
abd892af3a Implement LWG 2488 - Make the placeholders constexpr.
This patch makes the bind placeholders in std::placeholders both (1) const and
(2) constexpr (See below).

This is technically a breaking change for any code using the placeholders
outside of std::bind and depending on them being non-const. However I don't
think this will break any real world code.

(1) Previously the placeholders were non-const extern globals in all
dialects. This patch changes these extern globals to be const in all dialects.
Since the cv-qualifiers don't participate in name mangling for globals this
is an ABI compatible change.

(2) Make the placeholders constexpr in C++11 and beyond. Although LWG 2488 only
applies to C++17 I don't see any reason not to backport this change.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 21:01:34 +00:00
Eric Fiselier
5078baa9e0 Make default_noexcept.pass.cpp container tests more portable. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 20:21:22 +00:00
Eric Fiselier
47920eb75e Work around MSVC bug in atomics.types.generic/address.pass.cpp test. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 19:59:11 +00:00
Eric Fiselier
a8c717009e Use L"cat" L"dog" when concatenating string literals. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 19:53:46 +00:00
Eric Fiselier
256f000cdc Add array bounds assertions to satisfy MSVC's /analyze flag. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 19:48:29 +00:00
Eric Fiselier
8c4dc32424 Add [[noreturn]] attribute to throw_bad_alloc_helper().
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273819 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 19:42:59 +00:00
Eric Fiselier
bbd1c53610 Avoid narrowing conversions in quoted test. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 19:37:23 +00:00
Weiming Zhao
dd421f5acd [libcxx] guard throw with exception enabling check
Summary: this fixes build error when built with c++14 and no exceptions

Reviewers: rmaprath

Subscribers: weimingz, grandinj, rmaprath, cfe-commits

Differential Revision: http://reviews.llvm.org/D21673

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-24 18:02:27 +00:00
Eric Fiselier
3aef68f27e Run list debug copy test in C++03.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273395 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 08:57:33 +00:00
Eric Fiselier
8d2b31567c Finish converting list _LIBCPP_DEBUG tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273394 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 08:47:43 +00:00
Eric Fiselier
111c696838 Cleanup _LIBCPP_DEBUG tests in std::list. More to come.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 08:01:27 +00:00
Eric Fiselier
55e084dd4d Cleanup filesystem::permissions ever more.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273392 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 07:57:38 +00:00
Eric Fiselier
e1a1a1ffb7 Avoid unnecessary stat call in filesystem::permissions implementation.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 07:24:00 +00:00