summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.assign
Commit message (Collapse)AuthorAgeFilesLines
* Revert r289727 due to PR31384Eric Fiselier2016-12-151-115/+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. llvm-svn: 289773
* Work around bug in initialization of std::array base class with older clangsEric Fiselier2016-12-141-1/+3
| | | | llvm-svn: 289741
* [libcxx] Fix tuple construction/assignment from types derived from ↵Eric Fiselier2016-12-141-0/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 289727
* [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible ↵Stephan T. Lavavej2016-12-084-35/+35
| | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 289109
* 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
* Cleanup SFINAE in tuple, and add tests for reference assignmentEric Fiselier2016-07-022-0/+31
| | | | llvm-svn: 274414
* Mark more tuple tests as unsupported in C++98 && C++03Eric Fiselier2015-02-191-0/+2
| | | | llvm-svn: 229810
* [libcxx] Mark most tuple tests UNSUPPORTED for c++03 and c++98.Eric Fiselier2015-02-197-0/+14
| | | | | | | | | | | | | | 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
* We had two identical files named 'MoveOnly.h' in the test suite. Move one to ↵Marshall Clow2015-01-282-2/+2
| | | | | | 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-092-0/+2
| | | | | | 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-208-0/+409
llvm-svn: 224658
OpenPOWER on IntegriCloud