Commit Graph

676 Commits

Author SHA1 Message Date
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
d61ea34a58 Make shared_ptr constructor tests use count_new.hpp
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 04:51:07 +00:00
Eric Fiselier
604b5c48ec Don't use non-conforming pointer_traits specialization it tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273368 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 02:31:32 +00:00
Eric Fiselier
22bff1afcc Move remaining _LIBCPP_VERSION tests into test/libcxx
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273367 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 02:23:22 +00:00
Eric Fiselier
b93bc9a9ed Move typoed dir meta.hel to meta.help
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273362 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:42:39 +00:00
Eric Fiselier
03dacbe87a Fix comment typos, strip trailing whitespace. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:23:51 +00:00
Eric Fiselier
14fe08bcb7 Avoid huge main() functions and huge arrays. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273354 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:13:44 +00:00
Eric Fiselier
a431a3abc5 Don't use C++17 terse static assert. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 01:10:14 +00:00
Eric Fiselier
91a5c559ba Suppress unused warnings in std::invoke tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273348 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:58:06 +00:00
Eric Fiselier
62957fb722 Guard libc++ assumption about identity hashing in test. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 00:53:35 +00:00
Eric Fiselier
fa5a105971 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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-21 23:19:13 +00:00
Eric Fiselier
461797d21a Fix warning in tuple tests. The test suite should now run clean with most warnings enabled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 19:41:52 +00:00
Eric Fiselier
a995776958 Improve portability of hash tests. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272744 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 01:42:35 +00:00
Eric Fiselier
d0eba8d313 Fix bad test that was previously getting ifdef-ed away
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 21:50:30 +00:00
Eric Fiselier
d24c465bea 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!


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272716 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 21:31:42 +00:00
Eric Fiselier
bfdae2062a Fix warnings in tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272629 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 03:21:49 +00:00
Eric Fiselier
afa2f4331a Prevent truncation warning. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272621 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 02:54:15 +00:00
Eric Fiselier
bf5a4189d3 Remove _LIBCPP_TRIVIAL_PAIR_COPY_CTOR option.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272613 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 01:36:15 +00:00
Asiri Rathnayake
1575e3e813 [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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 21:40:03 +00:00
Eric Fiselier
3bf0d98eb1 Add not_fn test for throwing operator!
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 08:37:00 +00:00
Eric Fiselier
03b9c6b922 Mark LWG issue 2545 as complete. Add extra tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 05:44:14 +00:00
Eric Fiselier
b36940bb34 Fix leak in __enable_weak_this(). Thanks to Arthur O'Dwyer for finding it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271487 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 04:57:00 +00:00
Eric Fiselier
e98bd2a486 Mark LWG issue 2250 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 04:03:31 +00:00
Eric Fiselier
400d356341 Mark LWG issue 2450 as complete.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 03:12:44 +00:00
Eric Fiselier
c230822a61 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271464 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 01:25:41 +00:00
Eric Fiselier
dbfa5b6ea7 Remove enable_shared_from_this test since it leaks the control block and fails with ASAN
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 01:09:12 +00:00
Eric Fiselier
18e1ea69ae 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 00:15:35 +00:00
Eric Fiselier
84acb1ec3f Remove trailing whitespace in test suite. Approved by Marshall Clow.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271435 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 21:35:39 +00:00
Eric Fiselier
8a8c114479 Mark LWG issue 2520 as complete
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31 04:27:57 +00:00
Eric Fiselier
979137793e Mark LWG issue 2565 as complete. Update the tests to check it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31 00:23:31 +00:00
Asiri Rathnayake
a3eac518e6 [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 08:57:35 +00:00
Eric Fiselier
1f21fcd10a Guard testing of tuple extensions to make tests portable
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 22:41:45 +00:00
Marshall Clow
5d98497d0b Add a test for uniqueptr having either NULL and nullptr
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@269665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16 16:57:15 +00:00
Marshall Clow
aee206a3a1 Apply D20014 - fix a missing return in a test. Fixes PR#27720
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@269298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12 14:31:35 +00:00
Eric Fiselier
4db388b579 Change allocator<T>::allocate to throw length_error, not bad_alloc
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@268842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07 03:12:24 +00:00
Eric Fiselier
8a7462d163 Removing some trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@268543 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04 20:29:19 +00:00
Eric Fiselier
6aec0206da Fix PR27538. Remove __is_convertible specializations for array and function types.
This patch fixes a bunch of bugs in the fallback implementation of
is_convertible, which is used by GCC. Removing the "__is_convertible"
specializations for array/function types we fallback on the SFINAE test,
which is more correct.

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@268359 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 04:26:02 +00:00
Eric Fiselier
a9ea11398d Void cast runtime-unused variables. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@268284 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 19:15:48 +00:00
Eric Fiselier
1e5a4a4a71 Fix or move various non-standard tests.
This patch does the following:

* Remove <__config> includes from some container tests.
* Guards uses of std::launch::any in async tests because it's an extension.
* Move "test/std/extensions" to "test/libcxx/extensions"
* Moves various non-standard tests including those in "sequences/vector",
  "std/localization" and "utilities/meta".


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 04:07:45 +00:00
Eric Fiselier
96becae308 Move INVOKE tests into test/libcxx sub-tree.
Testing the concrete implementation of INVOKE means calling the implementation
specific names `__invoke` and `__invoke_constexpr`. For this reason the test
are non-standard. For this reason it's best if the tests live outside of the
`test/std` directory.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 01:52:57 +00:00
Eric Fiselier
6531a09dc7 Add proper include for unique_ptr. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 00:37:56 +00:00
Eric Fiselier
375e2f669c Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macros
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267947 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 22:28:23 +00:00
Eric Fiselier
bda804ea25 Remove names of unreferenced parameters. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267852 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:17:56 +00:00
Eric Fiselier
849c551745 Add braces, move braces, and rename variables to avoid shadowing. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267844 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 02:45:11 +00:00
Eric Fiselier
ce24f965f1 Provide member function definitions to avoid warnings. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267843 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 02:18:48 +00:00
Eric Fiselier
4596c29195 Guard Clang and GCC specific pragmas. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 01:49:03 +00:00
Marshall Clow
d7f1f971d1 Rename a few tests that had typos in their names. No functional change. Thanks to STL for the catch
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-23 14:31:00 +00:00
Eric Fiselier
5ccbc48774 Fix some non-standard parts of our test suite. Reported by STL
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 10:33:56 +00:00
Eric Fiselier
8f1e73dfd2 Add is_swappable/is_nothrow_swappable traits
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267079 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 23:38:59 +00:00
Eric Fiselier
8d5cbd7ce2 Add 'is_callable' and 'is_nothrow_callable' traits and cleanup INVOKE.
The primary purpose of this patch is to add the 'is_callable' traits.
Since 'is_nothrow_callable' required making 'INVOKE' conditionally noexcept
I also took this oppertunity to implement a constexpr version of INVOKE.
This fixes 'std::experimental::apply' which required constexpr 'INVOKE support'.

This patch will be followed up with some cleanup. Primarly removing most
of "__member_function_traits" since it's no longer used by INVOKE (in C++11 at least).


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@266836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20 00:14:32 +00:00