summaryrefslogtreecommitdiffstats
path: root/test/std/utilities/tuple
Commit message (Collapse)AuthorAgeFilesLines
* Update all bug URL's to point to https://bugs.llvm.org/...Eric Fiselier2017-02-172-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@295434 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement LWG 2773 - std::ignore should be constexpr.Eric Fiselier2017-02-062-0/+77
| | | | | | | | In addition to the PR for LWG 2773 this patch also ensures that each of std::ignores constructors or assignment operators are constexpr. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294165 91177308-0d34-0410-b5e6-96231b3b80d8
* [libcxx] [test] Fix comment typos.Stephan T. Lavavej2017-02-052-2/+2
| | | | | | No functional change, no code review. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294160 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert previous cleanup; I got too agressive removing #ifdefsMarshall Clow2017-01-231-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292809 91177308-0d34-0410-b5e6-96231b3b80d8
* Removed some un-needed ifdefsMarshall Clow2017-01-231-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292806 91177308-0d34-0410-b5e6-96231b3b80d8
* [libcxx] [test] Fix comment typos, strip trailing whitespace.Stephan T. Lavavej2017-01-182-4/+4
| | | | | | No functional change, no code review. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292434 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix XPASS buildbot failure related to structured bindingsEric Fiselier2017-01-051-1/+1
| | | | | | | | | | | The test was previously set to XFAIL if __cpp_structured_bindings wasn't defined. However there are Clang 4.0 versions which do not define this macro but do provide structured bindings, which causes the test to pass unexpectedly. This patch changes the XFAIL to an UNSUPPORTED. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291060 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix verify test on 32 bit systemsEric Fiselier2017-01-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291031 91177308-0d34-0410-b5e6-96231b3b80d8
* [libcxx] Re-implement LWG 2770 again: Fix tuple_size to work with structured ↵Eric Fiselier2017-01-045-18/+307
| | | | | | | | | | | | | | | | | | | bindings Summary: This patch attempts to re-implement a fix for LWG 2770, but not the actual specified PR. The PR for 2770 specifies tuple_size<T const> as only conditionally providing a `::value` member. However C++17 structured bindings require `tuple_size<T const>` to be complete only if `tuple_size<T>` is also complete. Therefore this patch implements only provides the specialization `tuple_size<T CV>` iff `tuple_size<T>` is a complete type. This fixes http://llvm.org/PR31513. Reviewers: mclow.lists, rsmith, mpark Subscribers: mpark, cfe-commits Differential Revision: https://reviews.llvm.org/D28222 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291019 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-implement LWG 2770 - Fix tuple_size with structured bindings.Eric Fiselier2017-01-023-24/+16
| | | | | | | This patch implements the correct PR for LWG 2770. It also makes the primary tuple_size template incomplete again which fixes part of llvm.org/PR31513. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290846 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix unused parameters and variablesEric Fiselier2016-12-234-8/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290459 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix XFAILS for is_trivially_destructible traitEric Fiselier2016-12-151-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289802 91177308-0d34-0410-b5e6-96231b3b80d8
* Add tests for LWG 2796Eric Fiselier2016-12-151-0/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289780 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more test cases for PR31384Eric Fiselier2016-12-151-9/+59
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289778 91177308-0d34-0410-b5e6-96231b3b80d8
* Add test case for PR31384Eric Fiselier2016-12-151-0/+38
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289774 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r289727 due to PR31384Eric Fiselier2016-12-152-269/+0
| | | | | | | | This patch reverts the changes to tuple which fixed construction from types derived from tuple. It breaks the code mentioned in llvm.org/PR31384. I'll follow this commit up with a test case. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289773 91177308-0d34-0410-b5e6-96231b3b80d8
* Work around bug in initialization of std::array base class with older clangsEric Fiselier2016-12-142-3/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289741 91177308-0d34-0410-b5e6-96231b3b80d8
* [libcxx] Fix tuple construction/assignment from types derived from ↵Eric Fiselier2016-12-142-0/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tuple/pair/array. Summary: The standard requires tuple have the following constructors: ``` tuple(tuple<OtherTypes...> const&); tuple(tuple<OtherTypes...> &&); tuple(pair<T1, T2> const&); tuple(pair<T1, T2> &&); tuple(array<T, N> const&); tuple(array<T, N> &&); ``` However libc++ implements these as a single constructor with the signature: ``` template <class TupleLike, enable_if_t<__is_tuple_like<TupleLike>::value>> tuple(TupleLike&&); ``` This causes the constructor to reject types derived from tuple-like types; Unlike if we had all of the concrete overloads, because they cause the derived->base conversion in the signature. This patch fixes this issue by detecting derived types and the tuple-like base they are derived from. It does this by creating an overloaded function with signatures for each of tuple/pair/array and checking if the possibly derived type can convert to any of them. This patch fixes [PR17550]( https://llvm.org/bugs/show_bug.cgi?id=17550) This patch Reviewers: mclow.lists, K-ballo, mpark, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27606 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289727 91177308-0d34-0410-b5e6-96231b3b80d8
* [libcxx] [test] Add LIBCPP_ASSERT_NOEXCEPT/LIBCPP_ASSERT_NOT_NOEXCEPT, ↵Stephan T. Lavavej2016-12-092-7/+6
| | | | | | | | | | | | | | | | | | | | | | remove an unused variable. test/support/test_macros.h For convenience/greppability, add macros for libcxx-specific static_asserts about noexceptness. (Moving the definitions of ASSERT_NOEXCEPT/ASSERT_NOT_NOEXCEPT isn't technically necessary because they're macros, but I think it's better style to define stuff before using it.) test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp There was a completely unused `TrackedCallable obj;`. apply() isn't depicted with conditional noexcept in C++17. test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp Now that we have LIBCPP_ASSERT_NOEXCEPT, use it. Fixes D27622. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289264 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR27374 - Remove the implicit reduced-arity-extension in tuple.Eric Fiselier2016-12-081-7/+14
| | | | | | | | | | | | | | | | | | | This patch removes libc++'s tuple extension which allowed it to be constructed from fewer initializers than elements; with the remaining elements being default constructed. However the implicit version of this extension breaks conforming code. For example: int fun(std::string); int fun(std::tuple<std::string, int>); int x = fun("hello"); // ambigious Because existing code may already depend on this extension it can be re-enabled by defining _LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION. Note that the explicit version of this extension is still supported, although it's somewhat less useful than the implicit one. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289158 91177308-0d34-0410-b5e6-96231b3b80d8
* [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible ↵Stephan T. Lavavej2016-12-0810-85/+85
| | | | | | | | | | | | | | | | | | | | | loss of data", part 5/7. Instead of storing double in double and then truncating to int, store int in long and then widen to long long. This preserves test coverage (as these tests are interested in various tuple conversions) while avoiding truncation warnings. test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_pair.pass.cpp Since we aren't physically truncating anymore, t1 is equal to p0. test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp One edit is different from the usual pattern. Previously, we were storing double in double and then converting to A, which has an implicitly converting constructor from int. Now, we're storing int in int and then converting to A, avoiding the truncation. Fixes D27542. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289109 91177308-0d34-0410-b5e6-96231b3b80d8
* [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible ↵Stephan T. Lavavej2016-12-082-55/+55
| | | | | | | | | | | loss of data", part 4/7. Change char to long and remove some char casts. This preserves test coverage for tuple's heterogeneous comparisons, while avoiding int-to-char truncation warnings. Fixes D27541. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289108 91177308-0d34-0410-b5e6-96231b3b80d8
* [libcxx] [test] D27266: Remove spurious semicolons.Stephan T. Lavavej2016-12-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@288750 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement LWG 2770 - Make tuple_size<T> defined for all TEric Fiselier2016-11-133-4/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286779 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR30979 - tuple<move_only> is constructible from move_only const&Eric Fiselier2016-11-131-0/+50
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286774 91177308-0d34-0410-b5e6-96231b3b80d8
* [libcxx] [test] Replace _LIBCPP_STD_VER with TEST_STD_VER.Stephan T. Lavavej2016-11-0414-17/+40
| | | | | | | | | | | This replaces every occurrence of _LIBCPP_STD_VER in the tests with TEST_STD_VER. Additionally, for every affected file, #include "test_macros.h" is being added explicitly if it wasn't already there. https://reviews.llvm.org/D26294 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@286007 91177308-0d34-0410-b5e6-96231b3b80d8
* Make make_from_tuple tests more portable. Patch from STL@microsoft.comEric Fiselier2016-10-231-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284943 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing <memory> include in testEric Fiselier2016-10-081-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283633 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r276548 - Make pair/tuples assignment operators SFINAE properly.Eric Fiselier2016-07-252-0/+118
| | | | | | | | | I think I've solved issues with is_assignable and references to incomplete types. The updated patch adds tests for this case. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276603 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r276548 - Make pair/tuples assignment operators SFINAE properly.Eric Fiselier2016-07-252-118/+0
| | | | | | | | | | | | | | | This is a breaking change. The SFINAE required is instantiated the second the class is instantiated, and this can cause hard SFINAE errors when applied to references to incomplete types. Ex. struct IncompleteType; extern IncompleteType it; std::tuple<IncompleteType&> t(it); // SFINAE will blow up. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276598 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MSVC unreferenced parameter warning. Patch from STL@microsoft.comEric Fiselier2016-07-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276583 91177308-0d34-0410-b5e6-96231b3b80d8
* Make pair/tuples assignment operators SFINAE properly.Eric Fiselier2016-07-242-0/+118
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276548 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress warning in make_from_tuple tests.Eric Fiselier2016-07-181-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@275748 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement C++17 tuple bits. Including apply and make_from_tuple.Eric Fiselier2016-07-187-0/+1151
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@275745 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle std::get<T>(...) for std::tuple<>Eric Fiselier2016-07-021-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274422 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite std::get<Type>(...) helper using constexpr functions.Eric Fiselier2016-07-025-92/+35
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274418 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup SFINAE in tuple, and add tests for reference assignmentEric Fiselier2016-07-022-0/+31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274414 91177308-0d34-0410-b5e6-96231b3b80d8
* Make tuple_constructible and family lazy again.Eric Fiselier2016-07-021-0/+102
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274413 91177308-0d34-0410-b5e6-96231b3b80d8
* Flatten the tuple_element and __make_tuple_types implementations.Eric Fiselier2016-07-011-0/+34
| | | | | | | | | | | 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
* Move remaining _LIBCPP_VERSION tests into test/libcxxEric Fiselier2016-06-221-20/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273367 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment typos, strip trailing whitespace. Patch from STL@microsoft.comEric Fiselier2016-06-221-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273357 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR27684 - std::tuple no longer accepts reference to incomplete type in ↵Eric Fiselier2016-06-212-20/+56
| | | | | | | | | | | | | | | | | | 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
* Fix warning in tuple tests. The test suite should now run clean with most ↵Eric Fiselier2016-06-151-8/+3
| | | | | | warnings enabled git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272822 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace __cplusplus comparisons and dialect __has_feature checks with ↵Eric Fiselier2016-06-142-2/+6
| | | | | | | | | | 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
* Remove trailing whitespace in test suite. Approved by Marshall Clow.Eric Fiselier2016-06-0111-13/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271435 91177308-0d34-0410-b5e6-96231b3b80d8
* [libcxx] Improve tests to use the UNSUPPORTED lit directiveAsiri Rathnayake2016-05-284-16/+0
| | | | | | | | | | | | | | | | | | | 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
* Guard testing of tuple extensions to make tests portableEric Fiselier2016-05-275-2/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271065 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove names of unreferenced parameters. Patch from STL@microsoft.comEric Fiselier2016-04-281-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267852 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some non-standard parts of our test suite. Reported by STLEric Fiselier2016-04-221-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267131 91177308-0d34-0410-b5e6-96231b3b80d8
* Make tuples constructors conditionally EXPLICIT. See N4387Eric Fiselier2016-04-1911-3/+285
| | | | git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@266703 91177308-0d34-0410-b5e6-96231b3b80d8