diff options
| author | Eric Fiselier <eric@efcs.ca> | 2019-07-03 19:21:40 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2019-07-03 19:21:40 +0000 |
| commit | f1807a7df6b31f4b774bfc6ad207fee5d8d32b99 (patch) | |
| tree | 6849ace6a826cac36a704379eeaa30a65b5639de /libcxx/include | |
| parent | 6f419a33709e75b9c27cb2c1a1f1c20222079b61 (diff) | |
| download | bcm5719-llvm-f1807a7df6b31f4b774bfc6ad207fee5d8d32b99.tar.gz bcm5719-llvm-f1807a7df6b31f4b774bfc6ad207fee5d8d32b99.zip | |
Fix tuple's conditionally explicit constructors for very weird user
types.
It seems some people like to write types that can explicitly convert
to anything, but cannot be used to explicitly construct anything.
This patch makes tuple tolerate such types, as is required
by the standard.
llvm-svn: 365074
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/tuple | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libcxx/include/tuple b/libcxx/include/tuple index c192d100e14..de30e86c72b 100644 --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -521,6 +521,13 @@ class _LIBCPP_TEMPLATE_VIS tuple template <class ..._Args> static constexpr bool __enable_implicit() { return + __tuple_constructible< + tuple<_Args...>, + typename __make_tuple_types<tuple, + sizeof...(_Args) < sizeof...(_Tp) ? + sizeof...(_Args) : + sizeof...(_Tp)>::type + >::value && __tuple_convertible< tuple<_Args...>, typename __make_tuple_types<tuple, @@ -547,7 +554,8 @@ class _LIBCPP_TEMPLATE_VIS tuple { template <class _Tuple> static constexpr bool __enable_implicit() { - return __tuple_convertible<_Tuple, tuple>::value; + return __tuple_constructible<_Tuple, tuple>::value + && __tuple_convertible<_Tuple, tuple>::value; } template <class _Tuple> @@ -577,6 +585,7 @@ class _LIBCPP_TEMPLATE_VIS tuple template <class _Tuple> static constexpr bool __enable_implicit() { return _And< + __tuple_constructible<_Tuple, tuple>, __tuple_convertible<_Tuple, tuple>, _PreferTupleLikeConstructor<_Tuple> >::value; |

