summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/tuple/tuple.tuple
Commit message (Collapse)AuthorAgeFilesLines
* 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