summaryrefslogtreecommitdiffstats
path: root/libcxx/include/tuple
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix PR27684 - std::tuple no longer accepts reference to incomplete type in ↵Eric Fiselier2016-06-211-1/+1
| | | | | | | | | | | | | | | | | 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
* Make tuples constructors conditionally EXPLICIT. See N4387Eric Fiselier2016-04-191-9/+100
| | | | llvm-svn: 266703
* Cleanup and guard tuple's constructor SFINAE. Fixes PR22806 and PR23256.Eric Fiselier2016-04-151-45/+158
| | | | | | | | | | | | | | | | | | | | | 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-151-15/+18
| | | | | | | | | | | | | | | | | 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
* [libcxx] LWG2485: get() should be overloaded for const tuple&&. Patch from ↵Eric Fiselier2015-12-181-0/+24
| | | | | | | K-Ballo. Review: http://reviews.llvm.org/D14839 llvm-svn: 255941
* Fix some mistakes in the <utility> and <tuple> synopses. No functional ↵Marshall Clow2015-11-191-9/+9
| | | | | | change. Thannks to K-ballo for the patch llvm-svn: 253593
* [libcxx] Fix detection of __is_final.Eric Fiselier2015-06-131-4/+2
| | | | | | | | | | | | | | Summary: Currently we only enable the use of __is_final(...) with Clang. GCC also provides __is_final(...) since 4.7 in all standard modes. This patch creates the macro _LIBCPP_HAS_IS_FINAL to note the availability of `__is_final`. Reviewers: danalbert, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8795 llvm-svn: 239664
* Remove unneeded redeclaration of reference_wrapper.Eric Fiselier2015-03-211-2/+0
| | | | llvm-svn: 232887
* [libc++] Try and prevent evaluation of `is_default_constructible` on tuples ↵Eric Fiselier2015-02-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* tuple: Make operator<() linear instead of exponentialDuncan P. N. Exon Smith2015-01-211-2/+6
| | | | | | Patch by Matthew Dempsky! llvm-svn: 226641
* Fixes to get libc++ building on sun solaris. Patch from C Bergstrom.Eric Fiselier2014-11-251-2/+2
| | | | llvm-svn: 222794
* Fixes PR21157 'tuple: non-default constructible tuple hard failure' Thanks ↵Marshall Clow2014-10-151-11/+31
| | | | | | to Louis Dionne for the bug report and the patch. llvm-svn: 219785
* Thanks to K-ballo for noting a second incorrect noexcept clause in tuple - ↵Marshall Clow2014-09-161-3/+3
| | | | | | and suggesting a more correct way to write the first llvm-svn: 217884
* Fix a bad noexcept clause in tuple's move constructorMarshall Clow2014-09-161-2/+2
| | | | llvm-svn: 217878
* D4451: Fix copy/move issues casude by __tuple_leafs's converting constructorEric Fiselier2014-07-241-2/+17
| | | | llvm-svn: 213888
* Some calls to get<>() were qualified. Some were not. Qualify them all. Fixes ↵Marshall Clow2014-06-241-8/+8
| | | | | | bug #20092. Thanks to Agustín Bergé for the bug report and the fix. llvm-svn: 211563
* Default the copy and move constructors for __tuple_leaf. This fixes bugs ↵Marshall Clow2014-04-211-11/+2
| | | | | | 18853 and 19118. Add a test case for that. llvm-svn: 206829
* Implement LWG Paper n3887: Consistent Metafunction Aliases. This adds ↵Marshall Clow2014-03-031-1/+8
| | | | | | std::tuple_element_t<> as an alias for tuple_element<>::type. Clean up the synopsis for tuple_element in <utility> as well. llvm-svn: 202673
* Implement LWG issue 2301: Mark std::tie as constexprMarshall Clow2014-02-251-2/+2
| | | | llvm-svn: 202158
* Rename ___make_pair_return to __make_pair_return_impl; ___make_tuple_return ↵Marshall Clow2014-01-031-3/+3
| | | | | | to __make_tuple_return_impl; and ____iterator_traits to __iterator_traits_impl. Part of a campaign to remove > 2 underscores from libc++. No functionality change. llvm-svn: 198457
* Fix several tuple bugs that were exposed by clang's implementation of CWG ↵Howard Hinnant2013-11-061-8/+19
| | | | | | 1402. This fixes http://llvm.org/bugs/show_bug.cgi?id=17798. llvm-svn: 194154
* Implement LWG issue 2275 'forward_as_tuple should be constexpr'Marshall Clow2013-10-051-11/+3
| | | | llvm-svn: 192038
* Remove non-printable chars that snuck in back in July; thanks to Yaron Keren ↵Marshall Clow2013-10-011-1/+1
| | | | | | for the catch llvm-svn: 191756
* Implement uses-allocator constructionMarshall Clow2013-09-121-62/+0
| | | | llvm-svn: 190571
* Nico Rieck: this patch series fixes visibility issues on Windows as ↵Howard Hinnant2013-08-121-8/+8
| | | | | | explained in <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html>. llvm-svn: 188192
* Make tuple's constructor and std::get<>(tuple) constexpr. Final stage of ↵Marshall Clow2013-07-221-55/+59
| | | | | | fixing bug #16599. Thanks to Howard for the review and updates. llvm-svn: 186834
* Make std::get constexprMarshall Clow2013-07-171-9/+9
| | | | llvm-svn: 186525
* Make std::forward and std::move (and std::move_if_noexcept) constexpr in C++14Marshall Clow2013-07-151-1/+1
| | | | llvm-svn: 186344
* Implement n3584 - Addressing Tuples by TypeMarshall Clow2013-07-131-0/+65
| | | | llvm-svn: 186237
* Accidentally disallowed explicit tuple conversions when all elements of the ↵Howard Hinnant2013-04-141-1/+1
| | | | | | tuple can be explicitly converted. llvm-svn: 179467
* No functionality change at this time. I've split _LIBCPP_VISIBLE up into ↵Howard Hinnant2013-03-061-8/+8
| | | | | | two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute. llvm-svn: 176593
* Rename uses of _ and __ because these are getting stepped on by macros from ↵Howard Hinnant2012-10-301-1/+1
| | | | | | other system code. llvm-svn: 167038
* Dimitry Andric: many visibility fixes. Howard: Much appreciated. Can you ↵Howard Hinnant2012-09-141-1/+1
| | | | | | send me a patch to CREDITS.TXT? llvm-svn: 163862
* Appy constexpr to <memory>. Picked up a few missing noexcepts as well.Howard Hinnant2012-07-071-0/+4
| | | | llvm-svn: 159902
* Apply noexcept to tuple.Howard Hinnant2012-07-061-24/+48
| | | | llvm-svn: 159865
* As a conforming extension give tuple a noexcept default constructor ↵Howard Hinnant2012-07-061-5/+9
| | | | | | conditionalized on its held types. llvm-svn: 159858
* Give tuple a constexpr default constructor.Howard Hinnant2012-07-061-3/+9
| | | | llvm-svn: 159857
* I believe tuple is still under development in the standard. Daniel Krugler ↵Howard Hinnant2012-04-011-6/+52
| | | | | | is/will be making convincing arguments that a modified form of LWG 2051 (currently NAD Future) is easily acheivable and desirable. He has demonstrated that a tuple<T...> where all of the T are implicitly convertible from U... should have a tuple constructor that is also implicit, instead of explicit. This would support the use cases in LWG 2051 while not undermining T... with explicit conversions from U.... This check-in is an experimental implementation of Daniel's work. I believe this work to be mature enough to warrant inclusion into libc++. If anyone sees real-world problems that this check in causes, please let me know and I will revert it, and provide the feedback to the LWG. llvm-svn: 153855
* tuple was accidentally lacking a valid copy assignment operator. It went ↵Howard Hinnant2012-02-151-0/+8
| | | | | | undetected because I had failed to test assigning from a const lvalue. This fixes http://llvm.org/bugs/show_bug.cgi?id=11921 llvm-svn: 150613
* Fix http://llvm.org/bugs/show_bug.cgi?id=11616Howard Hinnant2011-12-191-1/+60
| | | | llvm-svn: 146881
* Fix http://llvm.org/bugs/show_bug.cgi?id=11461. Credit Alberto Ganesh Barbati.Howard Hinnant2011-12-111-1/+5
| | | | llvm-svn: 146345
* Quash a whole bunch of warningsHoward Hinnant2011-12-011-14/+14
| | | | llvm-svn: 145624
* Further macro protection by replacing _[A-Z] with _[A-Z]pHoward Hinnant2011-11-291-13/+13
| | | | llvm-svn: 145410
* Windows support by Ruben Van Boxem.Howard Hinnant2011-10-171-0/+2
| | | | llvm-svn: 142235
* Fix <rdar://problem/10226704>Howard Hinnant2011-10-041-5/+0
| | | | llvm-svn: 141054
* _STD -> _VSTD to avoid macro clash on windowsHoward Hinnant2011-06-301-38/+38
| | | | llvm-svn: 134190
* Experimental support for a meaningful __is_swappable<T>::value. This does ↵Howard Hinnant2011-06-011-1/+5
| | | | | | not appear to be strictly needed for correct functioning of the library. If it causes any problems, I'd rather pull it sooner rather than later. llvm-svn: 132421
* noexcept for <tuple>. And in the process learned that I had done it wrong ↵Howard Hinnant2011-05-271-14/+43
| | | | | | for pair's swap. I needed to create an __is_nothrow_swappable<T>::value trait that was smart enought to answer false when __is_swappable<T>::value is false. Otherwise one gets compile-time errors when using pair or tuple of non-swappable types, even if you never try to swap the pair or tuple. llvm-svn: 132204
* tweak for readability (no functionality change)Howard Hinnant2011-01-251-1/+1
| | | | llvm-svn: 124192
* An rvalue reference cannot bind to an lvalue, so static_cast theDouglas Gregor2011-01-251-1/+2
| | | | | | | result of the __tuple_leaf::get() call to an rvalue reference when returning from tuple's get(). llvm-svn: 124190
OpenPOWER on IntegriCloud