summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/tuple/tuple.tuple
Commit message (Collapse)AuthorAgeFilesLines
* Make make_from_tuple tests more portable. Patch from STL@microsoft.comEric Fiselier2016-10-231-4/+4
| | | | llvm-svn: 284943
* Add missing <memory> include in testEric Fiselier2016-10-081-0/+1
| | | | llvm-svn: 283633
* 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. llvm-svn: 276603
* 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. llvm-svn: 276598
* Fix MSVC unreferenced parameter warning. Patch from STL@microsoft.comEric Fiselier2016-07-241-1/+1
| | | | llvm-svn: 276583
* Make pair/tuples assignment operators SFINAE properly.Eric Fiselier2016-07-242-0/+118
| | | | llvm-svn: 276548
* Suppress warning in make_from_tuple tests.Eric Fiselier2016-07-181-0/+4
| | | | llvm-svn: 275748
* 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. llvm-svn: 275745
* Handle std::get<T>(...) for std::tuple<>Eric Fiselier2016-07-021-0/+3
| | | | llvm-svn: 274422
* Rewrite std::get<Type>(...) helper using constexpr functions.Eric Fiselier2016-07-025-92/+35
| | | | llvm-svn: 274418
* Cleanup SFINAE in tuple, and add tests for reference assignmentEric Fiselier2016-07-022-0/+31
| | | | llvm-svn: 274414
* Make tuple_constructible and family lazy again.Eric Fiselier2016-07-021-0/+102
| | | | llvm-svn: 274413
* 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. llvm-svn: 274330
* 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 llvm-svn: 273334
* 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! llvm-svn: 272716
* Remove trailing whitespace in test suite. Approved by Marshall Clow.Eric Fiselier2016-06-0111-13/+13
| | | | llvm-svn: 271435
* [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 llvm-svn: 271108
* Guard testing of tuple extensions to make tests portableEric Fiselier2016-05-275-2/+16
| | | | llvm-svn: 271065
* Remove names of unreferenced parameters. Patch from STL@microsoft.comEric Fiselier2016-04-281-2/+2
| | | | llvm-svn: 267852
* Fix some non-standard parts of our test suite. Reported by STLEric Fiselier2016-04-221-0/+1
| | | | llvm-svn: 267131
* Make tuples constructors conditionally EXPLICIT. See N4387Eric Fiselier2016-04-1911-3/+285
| | | | llvm-svn: 266703
* Cleanup and guard tuple's constructor SFINAE. Fixes PR22806 and PR23256.Eric Fiselier2016-04-153-2/+278
| | | | | | | | | | | | | | | | | | | | | 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
* [libcxx] Remove the "reduced-arity-initialization" extension from the ↵Eric Fiselier2016-04-152-55/+98
| | | | | | | | | | | | | | | | | 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
* Fix type in tuple test. Sorry for the noiseEric Fiselier2015-12-181-2/+2
| | | | llvm-svn: 255944
* [libcxx] LWG2485: get() should be overloaded for const tuple&&. Patch from ↵Eric Fiselier2015-12-183-6/+153
| | | | | | | K-Ballo. Review: http://reviews.llvm.org/D14839 llvm-svn: 255941
* [libc++] Try and prevent evaluation of `is_default_constructible` on tuples ↵Eric Fiselier2015-02-211-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | default constructor if it is not needed. Summary: Currently parts of the SFINAE on tuples default constructor always gets evaluated even when the default constructor is never called or instantiated. This can cause a hard compile error when a tuple is created with types that do not have a default constructor. Below is a self contained example using a pair like class. This code will not compile but probably should. ``` #include <type_traits> template <class T> struct IllFormedDefaultImp { IllFormedDefaultImp(T x) : value(x) {} constexpr IllFormedDefaultImp() {} T value; }; typedef IllFormedDefaultImp<int &> IllFormedDefault; template <class T, class U> struct pair { template <bool Dummy = true, class = typename std::enable_if< std::is_default_constructible<T>::value && std::is_default_constructible<U>::value && Dummy>::type > constexpr pair() : first(), second() {} pair(T const & t, U const & u) : first(t), second(u) {} T first; U second; }; int main() { int x = 1; IllFormedDefault v(x); pair<IllFormedDefault, IllFormedDefault> p(v, v); } ``` One way to fix this is to use `Dummy` in a more involved way in the constructor SFINAE. The following patch fixes these sorts of hard compile errors for tuple. Reviewers: mclow.lists, rsmith, K-ballo, EricWF Reviewed By: EricWF Subscribers: ldionne, cfe-commits Differential Revision: http://reviews.llvm.org/D7569 llvm-svn: 230120
* Mark more tuple tests as unsupported in C++98 && C++03Eric Fiselier2015-02-192-0/+4
| | | | llvm-svn: 229810
* [libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.Eric Fiselier2015-02-1950-0/+100
| | | | | | | | | | | | | | Summary: No declaration for the type `tuple` is given in c++03 or c++98 modes. Mark all tests that use the actual `tuple` type as UNSUPPORTED. Reviewers: jroelofs, mclow.lists, danalbert Reviewed By: danalbert Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5956 llvm-svn: 229808
* Get tests running with warnings. Fix warnings in headers and testsEric Fiselier2015-02-055-4/+18
| | | | llvm-svn: 228344
* We had two identical files named 'MoveOnly.h' in the test suite. Move one to ↵Marshall Clow2015-01-2811-60/+10
| | | | | | support/, remove the other, and update all the tests that included them. No functionality change. llvm-svn: 227370
* Walter Brown sent a list of tests which needed 'additional includes' to ↵Marshall Clow2015-01-096-0/+6
| | | | | | match what was in the standard. Added these includes to the tests. No changes to the library or test results. llvm-svn: 225541
* Move test into test/std subdirectory.Eric Fiselier2014-12-2058-0/+3785
llvm-svn: 224658
OpenPOWER on IntegriCloud