Commit Graph

1668 Commits

Author SHA1 Message Date
Eric Fiselier 1662951974 Fix portability issues in <random> tests. Patch from STL@microsoft.com
llvm-svn: 276585
2016-07-24 23:36:18 +00:00
Eric Fiselier 307e4216b2 Mark bucket() assertions as non-portable. Patch from STL@microsoft.com
llvm-svn: 276584
2016-07-24 23:34:18 +00:00
Eric Fiselier 1b3eb43252 Fix MSVC unreferenced parameter warning. Patch from STL@microsoft.com
llvm-svn: 276583
2016-07-24 23:32:48 +00:00
Eric Fiselier f950b85122 Make move_noexcept.pass.cpp tests more portable. Patch from STL@microsoft.com
llvm-svn: 276581
2016-07-24 23:19:51 +00:00
Eric Fiselier e028cd8af8 Make bucket_count() greater-equal assertions portable. Patch from STL@microsoft.com
llvm-svn: 276580
2016-07-24 23:16:37 +00:00
Eric Fiselier ee410aca06 Mark bucket_size() assertions as non-portible. Patch from STL@microsoft.com
llvm-svn: 276578
2016-07-24 23:13:36 +00:00
Eric Fiselier 19244b67bc Guard libc++ specific tests SFINAE on std::bind's call operator. Patch from STL@microsoft.com
llvm-svn: 276576
2016-07-24 23:08:21 +00:00
Eric Fiselier d9ac87570e commit test missing from r276556
llvm-svn: 276558
2016-07-24 08:16:37 +00:00
Eric Fiselier 904a5d7007 Make pair/tuples assignment operators SFINAE properly.
llvm-svn: 276548
2016-07-24 05:51:11 +00:00
Eric Fiselier 2e99ae4f97 Fix memory leak in test.
llvm-svn: 276547
2016-07-24 04:41:44 +00:00
Eric Fiselier 790df14543 Implement LWG 2393. Check for LValue-callability.
llvm-svn: 276546
2016-07-24 04:16:40 +00:00
Eric Fiselier 63c69ef49c Implement LWG2328. Rvalue stream extraction should perfect forward.
llvm-svn: 276545
2016-07-24 04:07:22 +00:00
Eric Fiselier e4d9c316d2 Implement P0040r3: Extending memory management tools
llvm-svn: 276544
2016-07-24 03:51:39 +00:00
Eric Fiselier 58ad17df0f Implement the in_place tags from p0032r3.
That paper also has changes to any/optional but those will
be implemented later.

llvm-svn: 276537
2016-07-23 22:19:19 +00:00
Eric Fiselier 40492ba417 Fix undefined behavior in __hash_table
Summary:
This patch attempts to fix the undefined behavior in __hash_table by changing the node pointer types used throughout. The pointer types are changed for raw pointers in the current ABI and for fancy pointers in ABI V2 (since the fancy pointer types may not be ABI compatible).

The UB in `__hash_table` arises because tree downcasts the embedded end node and then deferences that pointer. Currently there are 2 node types in __hash_table:

* `__hash_node_base` which contains the `__next_` pointer.
* `__hash_node` which contains `__hash_` and `__value_`.

Currently the bucket list, iterators, and `__next_` pointers store pointers to `__hash_node` even though they all need to store `__hash_node_base` pointers.
This patch makes that change by introducing a `__next_pointer` typedef which is a pointer to `__hash_node` in the current ABI and `__hash_node_base` afterwards.

One notable change is to the type of `__bucket_list` which used to be defined as `unique_ptr<__node_pointer[], ...>` and is now `unique_ptr<__next_pointer[], ...>` meaning that we now allocate and deallocate different types using a different allocator. I'm going to give this part of the change more thought since it may introduce compatibility issues.

This change is similar to D20786.



Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 276533
2016-07-23 20:36:55 +00:00
Eric Fiselier 0fdab5eb69 Implement P0392r0. Integrate filesystem::path and string_view.
llvm-svn: 276511
2016-07-23 03:10:56 +00:00
Eric Fiselier 6f4a165e51 Revert r276506 - Diagnose invalid memory order arguments in <atomic>.
There is a bug in Clang 3.6 and earlier that causes compile failures.
I suspect it's due to the usage of member function parameter names in the
attributes.

llvm-svn: 276507
2016-07-23 01:43:53 +00:00
Eric Fiselier 586b16e16a [libcxx] Diagnose invalid memory order arguments in <atomic>. Fixes PR21179.
Summary:
This patch uses the __attribute__((enable_if)) hack suggested by @rsmith to diagnose invalid arguments when possible.

In order to diagnose an invalid argument `m` to `f(m)` we provide an additional overload of `f` that is only enabled when `m` is invalid. When that function is enabled it uses __attribute__((unavailable)) to produce a diagnostic message.

Reviewers: mclow.lists, rsmith, jfb, EricWF

Subscribers: bcraig, jfb, rsmith, cfe-commits

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

llvm-svn: 276506
2016-07-23 01:16:55 +00:00
Marshall Clow f067d20c6d Again, w/o the tabs
llvm-svn: 276273
2016-07-21 13:19:36 +00:00
Marshall Clow ef68f26b28 Another fix to appease the no-exception bots.
llvm-svn: 276272
2016-07-21 13:18:50 +00:00
Marshall Clow 187db16996 Fix some string_view tests that were failing when exceptions were disabled. Also comment out a _LIBCPP_ASSERT that gcc4.9 was complaining about. Will revisit that later.
llvm-svn: 276241
2016-07-21 06:24:04 +00:00
Marshall Clow 053d81ceeb Implement std::string_view as described in http://wg21.link/P0254R1. Reviewed as https://reviews.llvm.org/D21459
llvm-svn: 276238
2016-07-21 05:31:24 +00:00
Eric Fiselier 0e411641a3 Implement P0084r2. Changing emplace return types.
llvm-svn: 276230
2016-07-21 03:20:17 +00:00
Eric Fiselier 192c4f1a4a Disable warning flags when running .fail.cpp tests.
Increasingly the .fail.cpp tests are written using -verify, making them
sensitive to the exact diagnostics generated by the compiler. To prevent
additional diagnostics from being generated, and causing the tests to fail,
this patch removes the warning flags when compiling those tests.

llvm-svn: 276208
2016-07-20 23:37:28 +00:00
Eric Fiselier 7f1b098ab4 Unbreak traits tests by handling differences between version macros in clang/apple-clang.
llvm-svn: 276200
2016-07-20 22:53:21 +00:00
Eric Fiselier b2e7cc6994 Fix inheriting constructor test for std::function.
The test I originally checked in only worked with ToT Clang. This patch
updates the test so that it works as far back as 3.5.

llvm-svn: 276093
2016-07-20 06:46:22 +00:00
Eric Fiselier 85acffa676 Unbreak is_constructible tests for Clang <= 3.7.
There is a bug in Clang's __is_constructible builtin that causes it
to return true for function types; ex [T = void()].

llvm-svn: 276092
2016-07-20 06:36:11 +00:00
Eric Fiselier d5b5359802 Add missed test in r276090.
llvm-svn: 276091
2016-07-20 05:22:35 +00:00
Eric Fiselier b66b621038 Reimplement is_constructible fallback implementation. Fixes PR21574.
The previous implementation relied highly on specializations to handle
special cases. This new implementation lets the compiler do the work when possible.

llvm-svn: 276084
2016-07-20 05:01:24 +00:00
Eric Fiselier 074f8d7777 Add tests for reference binding assertions in std::tuple.
Libc++ provides static assertions to detect reference binding issues inside
tuple. This patch adds tests for those diagnostics.

It should be noted that these static assertions technically violate the
standard since it allows these illegal bindings to occur.

Also see https://llvm.org/bugs/show_bug.cgi?id=20855

llvm-svn: 276078
2016-07-20 02:57:39 +00:00
Eric Fiselier b11642bf94 Add SFINAE on additional overloads of std::complex functions. Fixes PR19921.
The functions arg, conj, imag, norm, proj, and real have additional overloads
for arguments of integral or floating point types. However these overloads should
not allow conversions to the integral/floating point types, only exact matches.

This patch constrains these functions so they no longer allow conversions.

llvm-svn: 276067
2016-07-20 00:14:10 +00:00
Eric Fiselier 331d21599d Add heterogeneous comparator support for __debug_less. Fixes PR17147.
llvm-svn: 276059
2016-07-19 23:27:18 +00:00
Eric Fiselier d05b10ab4f Fix undefined behavior in __tree
Summary:
This patch attempts to fix the undefined behavior in __tree by changing the node pointer types used throughout. The pointer types are changed for raw pointers in the current ABI and for fancy pointers in ABI V2 (since the fancy pointer types may not be ABI compatible).

The UB in `__tree` arises because tree downcasts the embedded end node and then deferences that pointer. Currently there are 3 node types in __tree.

* `__tree_end_node` which contains the `__left_` pointer. This node is embedded within the container.
* `__tree_node_base` which contains `__right_`, `__parent_` and `__is_black`. This node is used throughout the tree rebalancing algorithms.
* `__tree_node` which contains `__value_`.

Currently `__tree` stores the start of the tree, `__begin_node_`, as a pointer to a `__tree_node`. Additionally the iterators store their position as a pointer to a `__tree_node`. In both of these cases the pointee can be the end node. This is fixed by changing them to store `__tree_end_node` pointers instead.

To make this change I introduced an `__iter_pointer` typedef which is defined to be a pointer to either `__tree_end_node` in the new ABI or `__tree_node` in the current one.
Both `__tree::__begin_node_` and iterator pointers are now stored as `__iter_pointers`.

The other situation where `__tree_end_node` is stored as the wrong type is in `__tree_node_base::__parent_`.  Currently `__left_`, `__right_`, and `__parent_` are all `__tree_node_base` pointers. Since the end node will only be stored in `__parent_` the fix is to change `__parent_` to be a pointer to `__tree_end_node`.

To make this change I introduced a `__parent_pointer` typedef which is defined to be a pointer to either `__tree_end_node` in the new ABI or `__tree_node_base` in the current one.

Note that in the new ABI `__iter_pointer` and `__parent_pointer` are the same type (but not in the old one). The confusion between these two types is unfortunate but it was the best solution I could come up with that maintains the ABI.

The typedef changes force a ton of explicit type casts to correct pointer types and to make current code compatible with both the old and new pointer typedefs. This is the bulk of the change and it's really messy. Unfortunately I don't know how to avoid it.

Please let me know what you think.





Reviewers: howard.hinnant, mclow.lists

Subscribers: howard.hinnant, bbannier, cfe-commits

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

llvm-svn: 276003
2016-07-19 17:56:20 +00:00
Eric Fiselier 197228927a Remove locale tests that depend on enviroment variables.
Constructing a std::locale object from an empty string selects the language
from the current environment variables. If the environment variables name
a locale that doesn't exist, or isn't installed, then the construction of
facets using that locale may throw.

This patch removes tests that use 'std::locale l("")'.

The optimal solution would be to manually set the environment variables
in the test. Unfortunately there is no portable way to do this.

llvm-svn: 275772
2016-07-18 06:15:55 +00:00
Jonas Hahnfeld 16be8ee1ff [libcxx][filesystem] Remove setgid from parent before testing permissions
man page for mkdir says: "If the parent directory has the set-group-ID bit set,
then so will the newly created directory."

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

llvm-svn: 275760
2016-07-18 06:06:50 +00:00
Eric Fiselier a23470efe7 Rework libatomic handling in CMake and LIT.
This patch updates the way libc++ handles checking for libatomic, in part
to prepare for https://reviews.llvm.org/D22073.

Changes:
* 'LIBCXX_HAS_ATOMIC_LIB' is now set whenever libatomic is available even libc++
   doesn't need to manually link it.
* 'LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB' is now used to detect when libatomic
   needs to be manually linked.
* 'LIBCXX_HAS_ATOMIC_LIB' now adds 'libatomic' as a available feature in the
   test suite.

llvm-svn: 275759
2016-07-18 06:01:50 +00:00
Eric Fiselier 826f17399b Improve ABI tests for std::pair.
llvm-svn: 275757
2016-07-18 04:48:37 +00:00
Eric Fiselier fb946da259 Add checkpoint diagnostics to help diagnose buildbot failures.
llvm-svn: 275754
2016-07-18 03:00:09 +00:00
Eric Fiselier 03f46fc2ed Prevent failures by marking Clock::is_steady tests as UNSUPPORTED: asan.
llvm-svn: 275753
2016-07-18 02:29:33 +00:00
Eric Fiselier ec0a4c9946 Add includes in test. Patch from STL@microsoft.com
llvm-svn: 275751
2016-07-18 02:05:31 +00:00
Eric Fiselier 35b6413d1b Rename and rework `_LIBCPP_TRIVIAL_PAIR_COPY_CTOR`. Move FreeBSD configuration in-tree.
This patch does the following:

* It renames `_LIBCPP_TRIVIAL_PAIR_COPY_CTOR` to `_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR`.
* It automatically enables this option on FreeBSD in ABI V1, since that's the current ABI FreeBSD ships.
* It cleans up the handling of this option in `std::pair`.

I would like the sign off from the FreeBSD maintainers. They will no longer need to keep their `__config` changes downstream.

I'm still hoping to come up with a better way to maintain the ABI without needing these constructors.

Reviewed in https://reviews.llvm.org/D21329

llvm-svn: 275749
2016-07-18 01:58:37 +00:00
Eric Fiselier 1447da3383 Suppress warning in make_from_tuple tests.
llvm-svn: 275748
2016-07-18 01:52:46 +00:00
Eric Fiselier 03e29a2964 Implement C++17 tuple bits. Including apply and make_from_tuple.
This patch upgrades <tuple> to be C++17 compliant by implementing:

* tuple_size_v: This was forgotten when implementing the other _v traits.
* std::apply: This was added via LFTS v1 in p0220r1.
* std::make_from_tuple: This was added in p0209r2.

llvm-svn: 275745
2016-07-18 00:35:56 +00:00
Eric Fiselier 649da70def Fix std::experimental::optional tests. Patch from Casey Carter.
llvm-svn: 275732
2016-07-17 20:32:30 +00:00
Marshall Clow 10e8bef1d4 Add more tests for LWG#2582. No code changes needed, just tests.
llvm-svn: 275211
2016-07-12 20:15:46 +00:00
JF Bastien 5868e5dde9 libc++: name anonymous structs
As discussed in http://reviews.llvm.org/D22073

llvm-svn: 275210
2016-07-12 20:14:52 +00:00
Marshall Clow 8001ccd06e Add tests for the meta.unary.props that do not require a complete type. This is part of LWG#2582
llvm-svn: 275184
2016-07-12 15:50:53 +00:00
Marshall Clow dc3eb83d08 Always use the allocator to construct/destruct elements of a deque/vector. Fixes PR#28412. Thanks to Jonathan Wakely for the report.
llvm-svn: 275105
2016-07-11 21:38:08 +00:00
Eric Fiselier 0774aa96dc Allow is_swappable to SFINAE on deleted/ambiguous swap functions
llvm-svn: 275094
2016-07-11 19:57:13 +00:00
Marshall Clow bc3b1f3b7b Fix typo in #ifdef; leave tests commented out b/c gcc 4.8 harks on them.
llvm-svn: 274882
2016-07-08 16:59:54 +00:00
Manman Ren 78fa242ec2 Revert r274605 due to bot failure: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/244/
llvm-svn: 274651
2016-07-06 18:24:53 +00:00
Marshall Clow 5c29783bf2 Fix typo in #ifdef, and re-enable tests now that the green-dragon bots are no more
llvm-svn: 274605
2016-07-06 05:28:44 +00:00
Eric Fiselier 4f905b8daa Handle std::get<T>(...) for std::tuple<>
llvm-svn: 274422
2016-07-02 03:46:08 +00:00
Eric Fiselier f447e62e1d Rewrite std::get<Type>(...) helper using constexpr functions.
llvm-svn: 274418
2016-07-02 03:18:30 +00:00
Eric Fiselier 27cdf401ea Cleanup SFINAE in tuple, and add tests for reference assignment
llvm-svn: 274414
2016-07-02 01:25:46 +00:00
Eric Fiselier 7b60958aea Make tuple_constructible and family lazy again.
llvm-svn: 274413
2016-07-02 00:58:17 +00:00
Eric Fiselier 58b6e3e3d0 Turn off ASAN's odr-violation diagnostics for now. See PR28391
llvm-svn: 274404
2016-07-01 23:25:47 +00:00
Eric Fiselier 10b9a1bb42 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.

llvm-svn: 274330
2016-07-01 03:54:54 +00:00
Marshall Clow 3b8669edbf Fix static assert problem on gcc; remove XFAILs that I put in in r274250
llvm-svn: 274285
2016-06-30 22:05:45 +00:00
Eric Fiselier 19cf6b6c93 Fix C++03 build.
llvm-svn: 274274
2016-06-30 20:46:58 +00:00
Marshall Clow e46c0885ff Implement LWG#2688: 'clamp misses preconditions and has extraneous condition on result'. We already did this, just added tests
llvm-svn: 274252
2016-06-30 17:52:51 +00:00
Marshall Clow bc4618647f Temporarily XFAIL the incomplete type tests for GCC while I figure out why adding a static_assert in r274235 broken them
llvm-svn: 274250
2016-06-30 17:49:36 +00:00
Marshall Clow c8afc869b0 Implement LWG#2684: 'priority_queue lacking comparator typedef'. We already did this, just added tests
llvm-svn: 274243
2016-06-30 16:03:50 +00:00
Marshall Clow 81fce9729c Implement LWG#2596: 'vector::data() should use addressof'
llvm-svn: 274241
2016-06-30 15:50:55 +00:00
Marshall Clow e766a87b01 Implement LWG#2441: 'Exact-width atomic typedefs should be provided'
llvm-svn: 274236
2016-06-30 15:28:38 +00:00
Marshall Clow 497677449b Implement LWG#2436: 'Comparators for associative containers should always be CopyConstructible'
llvm-svn: 274235
2016-06-30 15:11:53 +00:00
Eric Fiselier d3c2acd38c Make futures.overview enum tests more portable. Patch from STL@microsoft.com
llvm-svn: 274211
2016-06-30 05:00:32 +00:00
Eric Fiselier b21f96ac4b Make std::array typedef tests more portable.
llvm-svn: 274210
2016-06-30 04:54:00 +00:00
Eric Fiselier 8892b4eef0 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.

llvm-svn: 274209
2016-06-30 04:40:50 +00:00
Eric Fiselier cb1fd66853 Make instreambuf.iterator/types.pass.cpp more portable.
llvm-svn: 274207
2016-06-30 04:31:09 +00:00
Eric Fiselier c76111a132 Fix use of terse static assert. Patch from STL@microsoft.com
llvm-svn: 274206
2016-06-30 04:29:12 +00:00
Eric Fiselier 3b0184321f Fix unary_function inheritance assumption. Patch from STL@microsoft.com
llvm-svn: 274205
2016-06-30 04:28:12 +00:00
Eric Fiselier 2bbb125d4e Fix unreferenced parameter warning. Patch from STL@microsoft.com
llvm-svn: 274204
2016-06-30 04:22:58 +00:00
Eric Fiselier 2afa66e124 Avoid applying unary minus to unsigned integers. Patch from STL@microsoft.com
llvm-svn: 274203
2016-06-30 04:21:52 +00:00
Akira Hatanaka 2556b769ec [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

llvm-svn: 274132
2016-06-29 15:26:13 +00:00
Eric Fiselier e3c72c1c85 Fix UB in uses_alloc_types.hpp
llvm-svn: 273840
2016-06-27 01:52:14 +00:00
Eric Fiselier 68436a9b48 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.

llvm-svn: 273839
2016-06-27 01:02:43 +00:00
Eric Fiselier 8b7faa6871 Implement p0337r0. Delete operator= for polymorphic_allocator.
llvm-svn: 273838
2016-06-27 00:55:25 +00:00
Eric Fiselier 9372d8bc61 Implement P0358r1. Fixes for not_fn.
llvm-svn: 273837
2016-06-27 00:40:41 +00:00
Eric Fiselier 06e9017d7b Fix C++03 failure in enable_shared_from_this test
llvm-svn: 273836
2016-06-27 00:38:28 +00:00
Eric Fiselier 39005d3019 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.

llvm-svn: 273835
2016-06-26 23:56:32 +00:00
Eric Fiselier 66fe5a4e2b Fix C++03 build
llvm-svn: 273832
2016-06-26 23:18:23 +00:00
Eric Fiselier bb94dca13a 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.

llvm-svn: 273831
2016-06-26 22:56:26 +00:00
Eric Fiselier 555330719a 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.

llvm-svn: 273824
2016-06-26 21:01:34 +00:00
Eric Fiselier a9fb19d3a5 Make default_noexcept.pass.cpp container tests more portable. Patch from STL@microsoft.com
llvm-svn: 273823
2016-06-26 20:21:22 +00:00
Eric Fiselier 7cca38bfd1 Work around MSVC bug in atomics.types.generic/address.pass.cpp test. Patch from STL@microsoft.com
llvm-svn: 273822
2016-06-26 19:59:11 +00:00
Eric Fiselier 384e012561 Use L"cat" L"dog" when concatenating string literals. Patch from STL@microsoft.com
llvm-svn: 273821
2016-06-26 19:53:46 +00:00
Eric Fiselier 2e0e3df9da Add array bounds assertions to satisfy MSVC's /analyze flag. Patch from STL@microsoft.com
llvm-svn: 273820
2016-06-26 19:48:29 +00:00
Eric Fiselier 3740071be0 Add [[noreturn]] attribute to throw_bad_alloc_helper().
llvm-svn: 273819
2016-06-26 19:42:59 +00:00
Eric Fiselier 95b5ac7df9 Avoid narrowing conversions in quoted test. Patch from STL@microsoft.com
llvm-svn: 273818
2016-06-26 19:37:23 +00:00
Eric Fiselier 351a709781 Run list debug copy test in C++03.
llvm-svn: 273395
2016-06-22 08:57:33 +00:00
Eric Fiselier 75fd25e4bc Finish converting list _LIBCPP_DEBUG tests.
llvm-svn: 273394
2016-06-22 08:47:43 +00:00
Eric Fiselier 3624fedb68 Cleanup _LIBCPP_DEBUG tests in std::list. More to come.
llvm-svn: 273393
2016-06-22 08:01:27 +00:00
Eric Fiselier eea7a01a28 Disable ccache usage for .fail.cpp tests. It causes bugs.
llvm-svn: 273390
2016-06-22 07:09:59 +00:00
Eric Fiselier 0e9272bee2 Placate MSVC's unchecked malloc warning in thread tests.
llvm-svn: 273385
2016-06-22 05:44:08 +00:00
Eric Fiselier 19d44836d7 Use correct Clang feature names. I got them wrong in the previous commit
llvm-svn: 273384
2016-06-22 05:40:17 +00:00
Eric Fiselier 94713d1671 Support old GCC exception and rtti detection macros
llvm-svn: 273383
2016-06-22 05:33:52 +00:00
Eric Fiselier 88d38802e2 Add tests for RTTI/exceptions test macros.
llvm-svn: 273382
2016-06-22 05:29:15 +00:00
Eric Fiselier eb067d4ebd Fix exception/rtti detection in tests.
So the macros TEST_HAS_NO_EXCEPTIONS and TEST_HAS_NO_RTTI were always
getting defined because I spelt __cpp_exceptions and __cpp_rtti as
__cxx_exceptions and __cxx_rtti.

Tests incoming after this patch.

llvm-svn: 273381
2016-06-22 05:03:10 +00:00
Eric Fiselier 74480010dc Make shared_ptr constructor tests use count_new.hpp
llvm-svn: 273379
2016-06-22 04:51:07 +00:00
Eric Fiselier 739cc95471 Make locale constructors tests use count_new.hpp
llvm-svn: 273375
2016-06-22 04:34:24 +00:00
Eric Fiselier cc4162293f Placate MSVC's unchecked malloc warnings.
llvm-svn: 273374
2016-06-22 04:23:54 +00:00
Eric Fiselier 32853ad707 UBSan doesn't globally replace new/delete but it still makes some tests fail. Investigation needed.
llvm-svn: 273372
2016-06-22 04:00:45 +00:00
Eric Fiselier 8ff7432534 Cleanup [list.modifiers] tests.
llvm-svn: 273371
2016-06-22 03:46:32 +00:00
Eric Fiselier a97d34a982 Don't use non-conforming pointer_traits specialization it tests.
llvm-svn: 273368
2016-06-22 02:31:32 +00:00
Eric Fiselier 56f23a3f7f Move remaining _LIBCPP_VERSION tests into test/libcxx
llvm-svn: 273367
2016-06-22 02:23:22 +00:00
Eric Fiselier 189d6a8834 Move more _LIBCPP_VERSION tests to test/libcxx.
llvm-svn: 273365
2016-06-22 02:07:26 +00:00
Eric Fiselier 0202dec266 Move all tests for _LIBCPP_VERSION in language.support to test/libcxx/language.support.
llvm-svn: 273364
2016-06-22 01:55:59 +00:00
Eric Fiselier 505ceacd3b Move typoed dir meta.hel to meta.help
llvm-svn: 273362
2016-06-22 01:42:39 +00:00
Eric Fiselier 77d2d95973 Use static_assert instead of runtime assert in std::money_base tests.
llvm-svn: 273360
2016-06-22 01:40:46 +00:00
Eric Fiselier bae51d36aa Remove locale tests that depend on LC_ALL. These are non-portable.
llvm-svn: 273359
2016-06-22 01:33:38 +00:00
Eric Fiselier 46fb2b903e Fix comment typos, strip trailing whitespace. Patch from STL@microsoft.com
llvm-svn: 273357
2016-06-22 01:23:51 +00:00
Eric Fiselier 8d0d842e7b Avoid huge main() functions and huge arrays. Patch from STL@microsoft.com
llvm-svn: 273354
2016-06-22 01:13:44 +00:00
Eric Fiselier 7a580d0a72 Don't use C++17 terse static assert. Patch from STL@microsoft.com
llvm-svn: 273353
2016-06-22 01:10:14 +00:00
Eric Fiselier 060ecaf672 Fix operator precedence mistake in valarray/not.pass.cpp. Patch from STL@microsoft.com
llvm-svn: 273352
2016-06-22 01:04:09 +00:00
Eric Fiselier 408d6ebd2d Suppress stupid and incorrect MSVC warning. patch from STL@microsoft.com
llvm-svn: 273350
2016-06-22 01:02:08 +00:00
Eric Fiselier df839e04b4 Avoid assignment in return. Patch from STL@microsoft.com
llvm-svn: 273349
2016-06-22 01:00:32 +00:00
Eric Fiselier c1d08ff069 Suppress unused warnings in std::invoke tests.
llvm-svn: 273348
2016-06-22 00:58:06 +00:00
Eric Fiselier 5f15481f87 Guard libc++ assumption about identity hashing in test. Patch from STL@microsoft.com
llvm-svn: 273345
2016-06-22 00:53:35 +00:00
Eric Fiselier c36f0331df Guard use of non-standard macros in denorm_min() tests.
llvm-svn: 273344
2016-06-22 00:50:09 +00:00
Eric Fiselier 0df0296974 Allow placement new array test to consume extra bytes as specified by the standard.
llvm-svn: 273342
2016-06-22 00:32:28 +00:00
Eric Fiselier 97e0ba02fd Move native_handle thread tests to test/libcxx
llvm-svn: 273341
2016-06-22 00:21:50 +00:00
Eric Fiselier 092386771d Fix PR27684 - std::tuple no longer accepts reference to incomplete type in some cases.
Libc++ has to deduce the 'allocator_arg_t' parameter as 'AllocArgT' for the
following constructor:

  template <class Alloc> tuple(allocator_arg_t, Alloc const&)

Previously libc++ has tried to support tags derived from 'allocator_arg_t' by
using 'is_base_of<AllocArgT, allocator_arg_t>'. However this breaks whenever a
2-tuple contains a reference to an incomplete type as its first parameter.

See https://llvm.org/bugs/show_bug.cgi?id=27684

llvm-svn: 273334
2016-06-21 23:19:13 +00:00
Eric Fiselier 44e2ebadb2 Implement LWG issue 2720. Replace perms::resolve_symlinks with perms::symlink_nofollow.
This changes how filesystem::permissions(p, perms) handles symlinks. Previously
symlinks were not resolved by default instead only getting resolved when
"perms::resolve_symlinks" was used. After this change symlinks are resolved
by default and perms::symlink_nofollow must be given to change this.

This issue has not yet been moved to Ready status, and I will revert if it
doesn't get moved at the current meeting. However I feel confident that it
will and it's nice to have implementations when moving issues.

llvm-svn: 273328
2016-06-21 22:42:42 +00:00
Eric Fiselier 310d3b975f Implement LWG issue 2725. The issue should move this meeting
llvm-svn: 273325
2016-06-21 22:11:16 +00:00
Eric Fiselier 48bc850917 Allow the libc++ build/source paths to contain symlinks.
The filesystem tests were expecting the paths to the build/source directories
did not contain any symlinks. This patch resolves those symlinks before running
the test suite.

llvm-svn: 273323
2016-06-21 21:54:23 +00:00
Jonathan Coe 945cacc842 Implement std::experimental::propagate_const from LFTS v2
Summary:
An implementation of std::experimental::propagate_const from Library Fundamentals Technical Specification v2.

No tests are provided for disallowed types like fancy pointers or function pointers as no code was written to handle these.

Reviewers: EricWF, mclow.lists

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

llvm-svn: 273122
2016-06-19 19:34:13 +00:00
Eric Fiselier 990952b664 Fix various undefined behavior found by UBSan.
* Fix non-null violation in strstream.cpp
  Overflow was calling memcpy with a null parameter and a size of 0.

* Fix std/atomics/atomics.flag/ tests:
  a.test_and_set() was reading from an uninitialized atomic, but wasn't
  using the value. The tests now clear the flag before performing the
  first test_and_set. This allows UBSAN to test that clear doesn't read
  an invalid value.

* Fix std/experimental/algorithms/alg.random.sample/sample.pass.cpp
  The tests were dereferencing a past-the-end pointer to an array so that
  they could do pointer arithmetic with it. Instead of dereference the iterator
  I changed the tests to use the special 'base()' test iterator method.

* Add -fno-sanitize=float-divide-by-zero to suppress division by zero UBSAN diagnostics.
  The tests that cause float division by zero are explicitly aware that they
  are doing that. Since this is well defined for IEEE floats suppress the warnings
  for now.

llvm-svn: 273107
2016-06-19 07:08:27 +00:00
Eric Fiselier be13be47ba Implement LWG issue 1169. num_get not fully compatible with strto*
Use strtof and strtod for floats and doubles respectively instead of
always using strtold. The other parts of the change are already implemented
in libc++.

This patch also has a drive by fix to wbuffer_convert::underflow() which
prevents it from calling memmove(buff, null, 0).

llvm-svn: 273106
2016-06-19 06:58:22 +00:00
Eric Fiselier 37ba54e5d7 Add UBSan blacklist for <__tree> and <__hash_table>
We all know <__tree> and <__hash_table> have plenty of UB that UBSan faithfully
finds. I am working on fixing this. However the noisy output from these failures
prevent automatically detecting regressions elsewhere.

This patch adds a blacklist file for these failures so I can later set up a
UBSAN buildbot.

llvm-svn: 273104
2016-06-19 02:25:22 +00:00
Eric Fiselier 629645d83d Fix bugs in last_write_time implementation.
* Fix passing a negative number as either tv_usec or tv_nsec. When file_time_type
  is negative and has a non-zero sub-second value we subtract 1 from tv_sec
  and make the sub-second duration positive.

* Detect and report when 'file_time_type' cannot be represented by time_t. This
  happens when using large/small file_time_type values with a 32 bit time_t.

There is more work to be done in the implementation. It should start to use
stat's st_mtim or st_mtimeval if it's provided as an extension. That way
we can provide a better resolution.

llvm-svn: 273103
2016-06-19 02:04:49 +00:00
Eric Fiselier 824ed8c03e Fix SleepFor(...) helper when a monotonic clock is not available.
Single threaded builds often don't provide a monotonic clock, so we can't
always provide a monotonic SleepFor(...) implementation. Hopefully this
won't cause the builds to hang.

llvm-svn: 273091
2016-06-18 18:32:26 +00:00
Eric Fiselier 97d72df6b0 Use monotonic clock in synthetic SleepFor test helper
llvm-svn: 273089
2016-06-18 17:51:11 +00:00
Eric Fiselier dc62be1915 Fix 3 bugs in filesystem tests and implementation.
This patch fixes the following bugs, all of which were discovered while
testing a 32 bit build on a 64 bit machine.

* path.itr/iterator.pass.cpp has undefined behavior.
  'path::iterator' stashes the value of the element inside the iterator.
  This violates the BiDirIterator requirements but is allowed for path::iterator.
  However this means that using reverse_iterator<path::iterator> has undefined
  behavior because it assumes that 'Iter tmp = it; return *tmp' will not create
  a dangling reference. However it does, and this caused this particular test
  to fail.

* path.native.obs/string_alloc.pass.cpp tested the SSO with a long string.
  On 32 bit builds std::wstring only has the SSO for strings of size 2. The
  test was using a string of size 4.

* fs.op.space/space.pass.cpp had overflows while calculating the expected values.
  The fix here is to convert the statvfs data members to std::uintmax_t before
  multiplying them. The internal implementation already does this but the tests
  needed to do it as well.

llvm-svn: 273078
2016-06-18 04:10:23 +00:00
Eric Fiselier ccc9826f56 Add additional tests in an attempt to diagnose ARM test failures.
Currently 4 tests are failing on the ARM buildbot. To try and diagnose each
of the failures this patch does the following:

1) path.itr/iterator.pass.cpp
   * Temporarily print iteration sequence to see where its failing.

2) path.native.obs/string_alloc.pass.cpp
   * Remove test that ::new is not called when constructing a short string
     that requires a conversion. Since during the conversion global locale
     objects might be constructed.

3) fs.op.funcs/space.pass.cpp
   * Explicitly use uintmax_t in the implementation of space, hopefully
     preventing possible overflows.
   * Add additional tests that check for overflow is the calculation of the
     space_info values.
   * Add additional tests for the values returned from statfvs.

4) fs.op.funcs/last_write_time.pass.cpp
   * No changes made yet.

llvm-svn: 273075
2016-06-18 02:11:48 +00:00
Eric Fiselier ed4035059f Add checkpoints to string allocation test to help with debugging arm failures.
llvm-svn: 273072
2016-06-18 00:23:13 +00:00
Eric Fiselier 25255013ba Fix bugs in recursive_directory_iterator::increment(ec) implementation and tests.
r273060 didn't completely fix the issues in recursive_directory_iterator and
the tests. This patch follows up with more fixes

* Fix bug where recursive_directory_iterator::increment(ec) did not reset
  the error code if no failure occurred.

* Fix bad assertion in the recursive_directory_iterator::increment(ec) test
  that would only fire for certain iteration orders.

llvm-svn: 273070
2016-06-17 23:57:16 +00:00
Eric Fiselier 5b58d0dffb Work around GCC bug in tests. The bug has been fixed in GCC 6.0
llvm-svn: 273068
2016-06-17 23:30:40 +00:00
Eric Fiselier 1544e657b2 Fix initialization of test case array in C++11
llvm-svn: 273065
2016-06-17 22:36:47 +00:00
Eric Fiselier e32264a4c0 Fix bugs in recursive_directory_iterator implementation and tests.
There are two fixes in this patch:

* Fix bug where the constructor of recursive_directory_iterator did not reset
  the error code if no failure occurred.

* Fix tests were dependent on the iteration order of the test directories.

llvm-svn: 273060
2016-06-17 22:22:37 +00:00
Eric Fiselier 93e3212c7c Get filesystem tests passing for single-threaded configurations.
llvm-svn: 273054
2016-06-17 21:44:26 +00:00
Eric Fiselier 5e1787a9ea Update status of filesystem issues, and add tests for LWG issue 2683
llvm-svn: 273051
2016-06-17 21:24:11 +00:00
Eric Fiselier 6aa4c100ad Reorder permissions test so they are not dependent on the processes umask
llvm-svn: 273049
2016-06-17 21:00:27 +00:00
Eric Fiselier 34ecebcb23 Respect the processes umask in the create_directory test
llvm-svn: 273048
2016-06-17 20:54:25 +00:00
Eric Fiselier 7b677ee0de Fix a couple of warnings present in the filesystem tests.
llvm-svn: 273035
2016-06-17 19:57:54 +00:00
Eric Fiselier c79795874a Add Filesystem TS -- Complete
Add the completed std::experimental::filesystem implementation and tests.
The implementation supports C++11 or newer.

The TS is built as part of 'libc++experimental.a'. Users of the TS need to
manually link this library. Building and testing the TS can be disabled using
the CMake option '-DLIBCXX_ENABLE_FILESYSTEM=OFF'.

Currently 'libc++experimental.a' is not installed by default. To turn on the
installation of the library use '-DLIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON'.

llvm-svn: 273034
2016-06-17 19:46:40 +00:00
Eric Fiselier 1ff954f752 Fix warning in tuple tests. The test suite should now run clean with most warnings enabled
llvm-svn: 272822
2016-06-15 19:41:52 +00:00
Eric Fiselier 4e7ab67c0b Add -Wno-unused-command-line-argument when running the test suite to prevent errors
llvm-svn: 272809
2016-06-15 17:25:05 +00:00
Eric Fiselier 4fae50267a [libcxx] [test] In test/support/test_allocator.h, fix construct() to avoid moving immovable types.
Summary:
In test/support/test_allocator.h, fix construct() to avoid moving immovable types.

This improves the allocator's conformance, and fixes compiler errors with MSVC's STL. The scenario is when the allocator is asked to construct an object of type X that's immovable (deleted copy/move ctors), but implicitly constructible from an argument type A. When perfectly forwarded, X can be (explicitly) constructed from A, and everything is fine. That's std::allocator's behavior, and the Standard's default when a user allocator's construct() doesn't exist. The previous implementation of construct() here mishandled this scenario. Passing A to this construct() would implicitly construct an X temporary, bound to (non-templated) T&&. Then construct() would attempt to move-construct X from that X temporary, but X is immovable, boom.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 272747
2016-06-15 01:53:32 +00:00
Eric Fiselier 0a707553a5 Improve portability of random_device tests. Patch from STL@microsoft.com
llvm-svn: 272746
2016-06-15 01:50:31 +00:00
Eric Fiselier 5d3e09ecc1 Improve portability of vector tests. Patch from STL@microsoft.com
llvm-svn: 272745
2016-06-15 01:44:22 +00:00
Eric Fiselier 78f8ce484f Improve portability of hash tests. Patch from STL@microsoft.com
llvm-svn: 272744
2016-06-15 01:42:35 +00:00
Eric Fiselier 1317a251c5 Fix bad test that was previously getting ifdef-ed away
llvm-svn: 272722
2016-06-14 21:50:30 +00:00
Eric Fiselier f2f2a6395f Replace __cplusplus comparisons and dialect __has_feature checks with TEST_STD_VER.
This is a huge cleanup that helps make the libc++ test suite more portable.
Patch from STL@microsoft.com. Thanks STL!

llvm-svn: 272716
2016-06-14 21:31:42 +00:00
Marshall Clow 9df8f6c472 Found a couple bugs in the test suite. No functionality change.
llvm-svn: 272679
2016-06-14 15:25:46 +00:00
Eric Fiselier db72c625e2 Update errcat.objects tests so they test the bug fixed in r272640.
llvm-svn: 272642
2016-06-14 06:37:36 +00:00
Eric Fiselier d046d5422a Avoid octal escape sequence warning with MSVC. Patch from STL@microsoft.com
llvm-svn: 272639
2016-06-14 05:47:46 +00:00
Eric Fiselier 9275b21947 Add missing include
llvm-svn: 272638
2016-06-14 04:58:19 +00:00
Eric Fiselier 596d408718 Temporarily XFAIL variadic lock_guard mangling test for GCC 4.9
llvm-svn: 272637
2016-06-14 04:45:26 +00:00
Eric Fiselier 48f35e074e Implement variadic lock_guard.
Summary:
This patch implements the variadic `lock_guard` paper. 

Making `lock_guard` variadic is a ABI breaking change because the specialization `lock_guard<_Mutex>` mangles differently then when it was the primary template. This change only provides variadic `lock_guard` in ABI V2 or when `_LIBCPP_ABI_VARIADIC_LOCK_GUARD` is defined.

Note that in ABI V2 `lock_guard` must always be declared as a variadic template, even in C++03, in order to keep the ABI consistent. For this reason `lock_guard` is forward declared as a variadic template in all standard dialects and therefore depends on variadic templates being provided as an extension in C++03. All supported versions of Clang and GCC provide this extension.




Reviewers: mclow.lists

Subscribers: K-ballo, mclow.lists, cfe-commits

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

llvm-svn: 272634
2016-06-14 03:48:09 +00:00
Eric Fiselier 9778a6d811 Make system_error::message() thread safe. Fixes PR25598.
Summary:
system_error::message() uses `strerror` for the generic and system categories. This function is not thread safe.

The fix is to use `strerror_r`. It has been available since 2001 for GNU libc and since BSD 4.4 on FreeBSD/OS X.
On platforms with GNU libc the extended version is used which always returns a valid string, even if an error occurs.

In single-threaded builds `strerror` is still used.

See https://llvm.org/bugs/show_bug.cgi?id=25598

Reviewers: majnemer, mclow.lists

Subscribers: erik65536, cfe-commits, emaste

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

llvm-svn: 272633
2016-06-14 03:45:31 +00:00
Eric Fiselier 10e3d1764a Ignore depricated warnings from <ext/hash_map> and <ext/hash_set>
llvm-svn: 272632
2016-06-14 03:26:11 +00:00
Eric Fiselier 3245e1f34b Fix warnings in tests.
llvm-svn: 272629
2016-06-14 03:21:49 +00:00
Eric Fiselier 84685fc831 Remove unused local var. Patch from STL@microsoft.com
llvm-svn: 272622
2016-06-14 02:55:21 +00:00
Eric Fiselier b03da3b65e Prevent truncation warning. Patch from STL@microsoft.com
llvm-svn: 272621
2016-06-14 02:54:15 +00:00
Eric Fiselier f81cfbab12 Fix vector<bool> tests that were using ints. Patch from STL@microsoft.com
llvm-svn: 272620
2016-06-14 02:53:04 +00:00
Eric Fiselier f4755f5b15 Rename variables to prevent shadowing. Patch from STL@microsoft.com
llvm-svn: 272619
2016-06-14 02:51:13 +00:00
Eric Fiselier b2cdce480a Avoid name shadowing in test. Patch from STL@microsoft.com
llvm-svn: 272618
2016-06-14 02:47:46 +00:00
Eric Fiselier 06d14341c5 Silence more unused variable warnings. Patch from STL@microsoft.com
llvm-svn: 272617
2016-06-14 02:46:39 +00:00
Eric Fiselier fbe79c9d25 Remove _LIBCPP_TRIVIAL_PAIR_COPY_CTOR option.
llvm-svn: 272613
2016-06-14 01:36:15 +00:00
Dan Albert ff2addf703 Add `REQUIRES: c++experimental` where appropriate.
Summary:
I haven't added it to all the tests, just those that fail without it
(those that aren't header only).

Reviewers: EricWF, mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 272443
2016-06-10 22:45:11 +00:00
Marshall Clow 54238fd381 Make the comparison objects that we pass in for various tests look more like actual comparison objects. No functional change.
llvm-svn: 272288
2016-06-09 18:34:38 +00:00
Marshall Clow 6a23af0f33 Avoid Shadowing warnings in the associative containers tests. Thanks to STL for the patch.
llvm-svn: 272018
2016-06-07 15:49:39 +00:00
Marshall Clow 217cf69b92 Rename some test data (and make it const) to rid us of some shadowing warnings in the test suite. No functional change. Thanks to STL@microsoft for the report and patch.
llvm-svn: 271919
2016-06-06 18:24:08 +00:00
Marshall Clow 3a407a096c Remove arithmetic +/-127 on chars; results in UB when dealing with signed chars. Thanks to STL@microsoft for the report.
llvm-svn: 271897
2016-06-06 14:35:22 +00:00
Asiri Rathnayake 981986cdfc [libcxx] Fix c++98 test failures.
Adds XFAIL/UNSUPPORTED lit tags as appropriate. Gets a clean test run
for -std=c++98 on Fedora 20.

NFC.

llvm-svn: 271741
2016-06-03 21:40:03 +00:00
Eric Fiselier 881334e76b Add not_fn test for throwing operator!
llvm-svn: 271502
2016-06-02 08:37:00 +00:00
Eric Fiselier eb066bc29d Fix TEST_HAS_NO_EXCEPTIONS misspelling in the test suite.
llvm-svn: 271501
2016-06-02 08:19:02 +00:00
Eric Fiselier 58ff77c2e0 Mark LWG issue 2545 as complete. Add extra tests
llvm-svn: 271489
2016-06-02 05:44:14 +00:00
Eric Fiselier 7cf29e3468 Fix leak in __enable_weak_this(). Thanks to Arthur O'Dwyer for finding it.
llvm-svn: 271487
2016-06-02 04:57:00 +00:00
Eric Fiselier 4efa1ad561 Mark LWG issue 2250 as complete
llvm-svn: 271475
2016-06-02 04:03:31 +00:00
Eric Fiselier d697ee41bc Mark LWG issue 2450 as complete.
llvm-svn: 271473
2016-06-02 03:12:44 +00:00
Eric Fiselier 5725756791 Add C++17 std::not_fn negator.
Summary:
Exactly what it sounds like.

I plan to commit this in a couple of days assuming no objections.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 271464
2016-06-02 01:25:41 +00:00
Eric Fiselier 39a724ea36 Remove enable_shared_from_this test since it leaks the control block and fails with ASAN
llvm-svn: 271459
2016-06-02 01:09:12 +00:00
Eric Fiselier 88f5bfdc5b Implement P0033R1 - Re-enabling shared_from_this
Summary: See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html

Reviewers: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 271449
2016-06-02 00:15:35 +00:00
Eric Fiselier d04c685168 Remove trailing whitespace in test suite. Approved by Marshall Clow.
llvm-svn: 271435
2016-06-01 21:35:39 +00:00
Eric Fiselier eb5cfb02d6 Cleanup non-standard tests as reported by STL@microsoft.com. NFC.
This patch addresses the following issues in the test suite:

1. Move "std::bad_array_length" test from std/ to libcxx/ test directory
   since the feature is not a part of the standard.

2. Rename "futures.tas" test directory to "futures.task" since that is the
   correct stable name.

3. Move tests for "packaged_task<T>::result_type" from std/ to libcxx/
   test directory since the typedef is a libc++ extension.

llvm-svn: 271430
2016-06-01 21:05:53 +00:00
Eric Fiselier 7939ae5e08 Mark LWG issue 2520 as complete
llvm-svn: 271249
2016-05-31 04:27:57 +00:00
Eric Fiselier b56f446e2d Add tests that got missed in r271247.
llvm-svn: 271248
2016-05-31 01:51:34 +00:00
Eric Fiselier 3bdbb10a48 Mark LWG issue 2537 as complete
llvm-svn: 271241
2016-05-31 01:11:20 +00:00
Eric Fiselier 0ddc14c256 Mark LWG issue #2585 as complete
llvm-svn: 271240
2016-05-31 01:03:07 +00:00
Eric Fiselier 4c46801fa7 Mark LWG issue 2565 as complete. Update the tests to check it.
llvm-svn: 271238
2016-05-31 00:23:31 +00:00
Eric Fiselier af4a5a7f33 Make string_view work with -fno-exceptions and get tests passing.
llvm-svn: 271237
2016-05-30 23:53:19 +00:00
Eric Fiselier 9ef549212c Fix bug in test allocator that incorrectly computed the allocation size
llvm-svn: 271195
2016-05-30 01:31:04 +00:00
Asiri Rathnayake 6edc12c886 [libcxx] Improve tests to use the UNSUPPORTED lit directive
Quite a few libcxx tests seem to follow the format:
 #if _LIBCPP_STD_VER > X
   // Do test.
 #else
   // Empty test.
 #endif
We should instead use the UNSUPPORTED lit directive to exclude the test on
earlier C++ standards. This gives us a more accurate number of test passes
for those standards and avoids unnecessary conflicts with other lit
directives on the same tests.

Reviewers: bcraig, ericwf, mclow.lists

Differential revision: http://reviews.llvm.org/D20730

llvm-svn: 271108
2016-05-28 08:57:35 +00:00
Eric Fiselier 71c425f199 Add missing include to test_iterators.h
llvm-svn: 271074
2016-05-27 23:43:29 +00:00
Eric Fiselier 38e229f909 Guard testing of tuple extensions to make tests portable
llvm-svn: 271065
2016-05-27 22:41:45 +00:00
Eric Fiselier 589308a0b1 Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
Summary:
GLIBC recently removed the incorrect `int isinf(double)` and `int isnan(double)` overloads in C++11 and greater. This causes previously `XFAIL: linux`  tests to start passing.

Since there is no longer a way to 'XFAIL' the tests I choose to simply tolerate this bug.

See https://sourceware.org/bugzilla/show_bug.cgi?id=19439


Reviewers: rsmith, mclow.lists, EricWF

Subscribers: jroelofs, cfe-commits

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

llvm-svn: 271060
2016-05-27 22:19:53 +00:00
Eric Fiselier 6a05b007ff Test hijacking ADL for operator& in the stream iterator constructors.
llvm-svn: 269838
2016-05-17 21:01:20 +00:00
Eric Fiselier 7b65137677 Add test for r269789
llvm-svn: 269812
2016-05-17 19:52:32 +00:00