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
505ceacd3b
Move typoed dir meta.hel to meta.help
...
llvm-svn: 273362
2016-06-22 01:42:39 +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
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
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
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
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
Eric Fiselier
3245e1f34b
Fix warnings in tests.
...
llvm-svn: 272629
2016-06-14 03:21:49 +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
fbe79c9d25
Remove _LIBCPP_TRIVIAL_PAIR_COPY_CTOR option.
...
llvm-svn: 272613
2016-06-14 01:36:15 +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
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
7939ae5e08
Mark LWG issue 2520 as complete
...
llvm-svn: 271249
2016-05-31 04:27:57 +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
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
38e229f909
Guard testing of tuple extensions to make tests portable
...
llvm-svn: 271065
2016-05-27 22:41:45 +00:00
Marshall Clow
779ddd134d
Add a test for uniqueptr having either NULL and nullptr
...
llvm-svn: 269665
2016-05-16 16:57:15 +00:00
Marshall Clow
1168ca925c
Apply D20014 - fix a missing return in a test. Fixes PR#27720
...
llvm-svn: 269298
2016-05-12 14:31:35 +00:00
Eric Fiselier
4524d6e739
Change allocator<T>::allocate to throw length_error, not bad_alloc
...
llvm-svn: 268842
2016-05-07 03:12:24 +00:00
Eric Fiselier
4a9578aefe
Removing some trailing whitespace
...
llvm-svn: 268543
2016-05-04 20:29:19 +00:00
Eric Fiselier
95b632d4b9
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
llvm-svn: 268359
2016-05-03 04:26:02 +00:00
Eric Fiselier
fb42f4c44a
Void cast runtime-unused variables. Patch from STL@microsoft.com
...
llvm-svn: 268284
2016-05-02 19:15:48 +00:00
Eric Fiselier
382e91792b
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".
llvm-svn: 267981
2016-04-29 04:07:45 +00:00
Eric Fiselier
bc32b5cf8f
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.
llvm-svn: 267973
2016-04-29 01:52:57 +00:00
Eric Fiselier
7d7d2c0edd
Add proper include for unique_ptr. Patch from STL@microsoft.com
...
llvm-svn: 267958
2016-04-29 00:37:56 +00:00
Eric Fiselier
1f4231f8cf
Guard libc++ specific c.__invariants() tests in LIBCPP_ASSERT macros
...
llvm-svn: 267947
2016-04-28 22:28:23 +00:00
Eric Fiselier
7626f778a5
Remove names of unreferenced parameters. Patch from STL@microsoft.com
...
llvm-svn: 267852
2016-04-28 03:17:56 +00:00
Eric Fiselier
0d62791983
Add braces, move braces, and rename variables to avoid shadowing. Patch from STL@microsoft.com
...
llvm-svn: 267844
2016-04-28 02:45:11 +00:00
Eric Fiselier
0f9e91acc8
Provide member function definitions to avoid warnings. Patch from STL@microsoft.com
...
llvm-svn: 267843
2016-04-28 02:18:48 +00:00
Eric Fiselier
e5eb7049eb
Guard Clang and GCC specific pragmas. Patch from STL@microsoft.com
...
llvm-svn: 267836
2016-04-28 01:49:03 +00:00
Marshall Clow
a64a8fc969
Rename a few tests that had typos in their names. No functional change. Thanks to STL for the catch
...
llvm-svn: 267287
2016-04-23 14:31:00 +00:00
Eric Fiselier
b530a2591b
Fix some non-standard parts of our test suite. Reported by STL
...
llvm-svn: 267131
2016-04-22 10:33:56 +00:00
Eric Fiselier
f07dd8d0a9
Add is_swappable/is_nothrow_swappable traits
...
llvm-svn: 267079
2016-04-21 23:38:59 +00:00
Eric Fiselier
840fa745ca
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).
llvm-svn: 266836
2016-04-20 00:14:32 +00:00
Ben Craig
e83514a546
XFAILing new test on C++03
...
initializer_list doesn't exist in C++03.
llvm-svn: 266820
2016-04-19 21:07:30 +00:00
Ben Craig
8743f8ca24
Include initializer_list from utility
...
The C++11 and C++14 standards both say in the header <utility> synopsis that
<utility> shall include <initializer_list>.
llvm-svn: 266808
2016-04-19 20:13:55 +00:00
Eric Fiselier
9795699a72
Make tuples constructors conditionally EXPLICIT. See N4387
...
llvm-svn: 266703
2016-04-19 01:19:25 +00:00
Eric Fiselier
2152fd7682
Implement LWG issue 2219 - support reference_wrapper in INVOKE
...
llvm-svn: 266590
2016-04-18 06:17:30 +00:00
Eric Fiselier
df691e18f3
Add hash specializations for __int128_t. Fixes LWG issue 2119
...
llvm-svn: 266587
2016-04-18 02:54:00 +00:00
Eric Fiselier
40fde4d33e
Add tests for LWG issue 2361
...
llvm-svn: 266586
2016-04-18 02:31:05 +00:00
Eric Fiselier
74cba6427a
Cleanup and guard tuple's constructor SFINAE. Fixes PR22806 and PR23256.
...
There are two main fixes in this patch.
First the constructor SFINAE was changed so that it's evaluated in two stages
where the first stage evaluates the "safe" SFINAE conditions and the second
evaluates the "dangerous" ones. The key is that the second stage is lazily
evaluated only if the first stage passes. This helps fix PR23256
(https://llvm.org/bugs/show_bug.cgi?id=23256 ).
The second fix is for PR22806 and LWG issue 2549. This fix applies
the suggested resolution to the LWG issue in order to prevent the construction
of dangling references. The SFINAE for this check is contained within
the _PreferTupleLikeConstructor alias template. The tuple-like constructors
are disabled whenever that trait returns false.
(https://llvm.org/bugs/show_bug.cgi?id=22806 )
(http://cplusplus.github.io/LWG/lwg-active.html#2549 )
llvm-svn: 266461
2016-04-15 18:05:59 +00:00
Eric Fiselier
90fb2baff7
[libcxx] Remove the "reduced-arity-initialization" extension from the uses-allocator constructors
...
Summary:
A default uses-allocator constructor has been added since that overload was previously provided by the extended constructor.
Since Clang does implicit conversion checking after substitution this constructor has to deduce the allocator_arg_t parameter so that it can prevent the evaluation of "is_default_constructible" if the first argument doesn't match. See http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1391 for more information.
This patch fixes PR24779 (https://llvm.org/bugs/show_bug.cgi?id=24779 )
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19006
llvm-svn: 266409
2016-04-15 03:29:40 +00:00
Eric Fiselier
a58d430cac
Make std::addressof constexpr in C++17 (Clang only).
...
llvm-svn: 263688
2016-03-17 03:30:56 +00:00
Marshall Clow
4251d3779f
Mark exception-throwing test as XFAIL when exceptions are disabled
...
llvm-svn: 263405
2016-03-14 02:51:50 +00:00
Marshall Clow
4cec709ed6
Fix for PR26812: possible overflow issue in std::allocator::allocate
...
llvm-svn: 262610
2016-03-03 12:04:39 +00:00
Marshall Clow
4877c197c2
Added tests to make sure that the categorization traits work on incomplete types
...
llvm-svn: 261925
2016-02-25 20:15:47 +00:00
Marshall Clow
71abfc1392
No, really - test the constructor
...
llvm-svn: 261875
2016-02-25 15:27:13 +00:00
Marshall Clow
6433044dc9
Add test to ensure that the converting constructor in N4089 is present and working
...
llvm-svn: 261874
2016-02-25 15:25:29 +00:00
Marshall Clow
1b9fae5a40
These new tests fail on the green-dragon bots, which use an old Apple compiler.
...
Since they're scheduled to be updated soon, we'll just comment out this test for
the moment, and re-commit when the bots are updated.
llvm-svn: 261661
2016-02-23 18:09:38 +00:00
Marshall Clow
9bb3582fc9
Add tests for LWG#2560. No code changes, just tests
...
llvm-svn: 261653
2016-02-23 17:01:52 +00:00
Eric Fiselier
060cc200d0
Fix PR26103 - Error calling is_convertible with incomplete type. Patch from Michael Daniels.
...
llvm-svn: 258852
2016-01-26 20:24:30 +00:00
Marshall Clow
0aa1ccb0d9
Implement LWG#2385; remove the allocator-aware std::function::assign call. It was useless, and didn't actually *do anything* with the allocator. Now it's gone. On the off chance that someone is mistakenly calling it, it's only gone in C++1z
...
llvm-svn: 258697
2016-01-25 17:29:55 +00:00
Marshall Clow
fcdb19904c
Implement LWG#2101 'Some transformation types can produce impossible types' Introduced a new (internal) type trait '__is_referenceable' with tests. Use that trait in add_lvalue_reference, add_rvalue_reference and add_pointer.
...
llvm-svn: 258418
2016-01-21 18:22:43 +00:00
Eric Fiselier
6469c3ec17
Mark some test XFAIL for GCC 4.9 due to missing is_trivial* traits
...
llvm-svn: 258287
2016-01-20 04:59:57 +00:00
Eric Fiselier
38236b5750
Add missing license headers
...
llvm-svn: 258196
2016-01-19 21:52:04 +00:00
Marshall Clow
df5ddf2c7a
One more missing std:: qualification from Jonathan
...
llvm-svn: 257506
2016-01-12 19:15:10 +00:00
Marshall Clow
8d113d430f
Add a bunch of missing includes in the test suite to make it more portable. Fixes bugs #26120 and #26121 . Thanks to Jonathan Wakely for the reports and the patches.
...
llvm-svn: 257474
2016-01-12 14:51:04 +00:00
Eric Fiselier
7a608aa232
[libcxx] Fix LWG Issue #2367 - Fixing std::tuple and std::pair's default constructors.
...
Summary: This patch implements the solution for LWG Issue #2367 . See http://cplusplus.github.io/LWG/lwg-active.html#2367
Reviewers: mclow.lists, EricWF
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D13750
llvm-svn: 256325
2015-12-23 08:20:26 +00:00
Eric Fiselier
51b9de4c7c
Fix type in tuple test. Sorry for the noise
...
llvm-svn: 255944
2015-12-18 01:04:36 +00:00
Eric Fiselier
545b8861fc
[libcxx] LWG2485: get() should be overloaded for const tuple&&. Patch from K-Ballo.
...
Review: http://reviews.llvm.org/D14839
llvm-svn: 255941
2015-12-18 00:36:55 +00:00
Eric Fiselier
831c112954
Fix various GCC mis-configurations for newer versions.
...
This patch goes through and enables C++11 and C++14 features for newer GCC's.
The main changes are:
1. Turn on variable templates. (Uses __cpp_variable_templates)
2. Assert atomic<Tp> is trivially copyable (Uses _GNUC_VER >= 501).
3. Turn on trailing return support for GCC. (Uses _GNUC_VER >= 404)
4. XFAIL void_t test for GCC 5.1 and 5.2. Fixed in GCC 6.
llvm-svn: 255585
2015-12-15 00:32:21 +00:00
Marshall Clow
6e07ccdfe1
K-Ballo pointed out a mistake in the add_lvalue_ref tests I checked in; now more of them are passing. Thanks
...
llvm-svn: 255519
2015-12-14 18:11:51 +00:00
Marshall Clow
161eae2daa
Add add_lvalue_ref tests for a few function types, with a note why not more
...
llvm-svn: 255513
2015-12-14 17:34:03 +00:00
Eric Fiselier
fff5ec035b
Use __make_integer_seq builtin for std::make_integer_sequence. Patch by K-ballo.
...
llvm-svn: 255162
2015-12-09 22:03:06 +00:00
Marshall Clow
b8427293df
Last bit of P0006; mark it as complete
...
llvm-svn: 254290
2015-11-30 05:39:30 +00:00
Marshall Clow
12dff9e66a
Fix bugs in alignment_of_v, etc. Re-enable the newly added tests
...
llvm-svn: 254289
2015-11-30 05:20:00 +00:00
Marshall Clow
00b6b01592
Temporarily disable new tests while I figure out what's going on
...
llvm-svn: 254288
2015-11-30 05:15:10 +00:00
Marshall Clow
c8f3816e63
Fix bad macros
...
llvm-svn: 254287
2015-11-30 05:10:10 +00:00
Marshall Clow
4ddfaea773
Implement more of P0006; Type Traits Variable Templates. <ratio>
...
llvm-svn: 254285
2015-11-30 05:04:22 +00:00
Marshall Clow
803a8bb105
Fix bad macros in tests
...
llvm-svn: 254284
2015-11-30 05:03:35 +00:00
Marshall Clow
e12a536d76
Implement more of P0006; Type Traits Variable Templates.
...
llvm-svn: 254283
2015-11-30 04:30:02 +00:00
Marshall Clow
1867554cc6
Add tests for the extended integer types - as required by LWG#2119
...
llvm-svn: 253376
2015-11-17 21:04:24 +00:00
Marshall Clow
dbd2d32892
Implement P0007: Constant View: A proposal for a std::as_const helper function template.
...
llvm-svn: 253274
2015-11-17 00:08:08 +00:00
Marshall Clow
dd1b261f3a
Implement P0013R1: Logical Operator Type Traits. Make a hidden implementation (__and_, __or_, and __not_) so that we can use them elsewhere in non-C++17 code - for example, in the LFTS
...
llvm-svn: 253215
2015-11-16 15:54:13 +00:00
Marshall Clow
183c010c9a
Implement P0074: Making owner_less more flexible
...
llvm-svn: 252905
2015-11-12 15:56:44 +00:00
Marshall Clow
d1180f4abc
Fix typo I just introduced.
...
llvm-svn: 252614
2015-11-10 16:10:17 +00:00
Marshall Clow
d17405fe9c
Walter pointed out some missing includes in the tests. Fixing the includes uncovered a couple bugs in the _v type traits. Fixed those, too
...
llvm-svn: 252612
2015-11-10 15:48:23 +00:00
Marshall Clow
bfba968360
Explicitly #include <utility> so that we get std::move. Thanks to Walter for the bug report.
...
llvm-svn: 252610
2015-11-10 15:22:08 +00:00
Asiri Rathnayake
f520c1445f
Make it possible to build a no-exceptions variant of libcxx.
...
Fixes a small omission in libcxx that prevents libcxx being built when
-DLIBCXX_ENABLE_EXCEPTIONS=0 is specified.
This patch adds XFAILS to all those tests that are currently failing
on the new -fno-exceptions library variant. Follow-up patches will
update the tests (progressively) to cope with the new library variant.
Change-Id: I4b801bd8d8e4fe7193df9e55f39f1f393a8ba81a
llvm-svn: 252598
2015-11-10 11:41:22 +00:00
Marshall Clow
8be59af1ed
More of P0006R0: type traits variable aliases for C++17.
...
llvm-svn: 252406
2015-11-07 17:44:36 +00:00
Marshall Clow
2cd0d6d625
Implement P0092R1 for C++1z
...
llvm-svn: 252195
2015-11-05 19:33:59 +00:00
Marshall Clow
79dfd99d30
Remove undefined behavior from some tests. Same pattern as the unitialized_copy tests
...
llvm-svn: 251804
2015-11-02 15:29:13 +00:00
Marshall Clow
8eb1d544f8
Remove undefined behavior from some tests. Thanks to Walter Brown for the heads-up.
...
llvm-svn: 251802
2015-11-02 15:25:53 +00:00
Marshall Clow
00ec0bf828
Improve the tests for 'is_literal_type'
...
llvm-svn: 251767
2015-11-01 21:13:10 +00:00
Marshall Clow
dd0ef09954
Implement the first part of P0006R0: Adopt Type Traits Variable Templates for C++17. Significantly augment the existing tests.
...
llvm-svn: 251766
2015-11-01 20:24:59 +00:00
Marshall Clow
3b72a6ef63
Fix LWG#2489: mem_fn() should be noexcept
...
llvm-svn: 251257
2015-10-25 20:12:16 +00:00