summaryrefslogtreecommitdiff
path: root/include/type_traits
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-12-27 19:59:50 +0000
committerEric Fiselier <eric@efcs.ca>2016-12-27 19:59:50 +0000
commit3010df98f9cbde7c1c6b16c052851067795047e4 (patch)
tree3044f27e572f20a6b5a68ee0453d76b909a515f3 /include/type_traits
parent833ad542b51d0d1f362ab0c2108ca4a29d7dcf28 (diff)
Fix PR31481 - 3+ parameter common_type isn't SFINAE friendly
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/type_traits')
-rw-r--r--include/type_traits14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/type_traits b/include/type_traits
index fbfc9d337..d970b7025 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -2020,13 +2020,21 @@ template <class ...Tp> struct __common_types;
template <class, class = void>
struct __common_type_impl {};
+template <class _Tp, class _Up>
+struct __common_type_impl<
+ __common_types<_Tp, _Up>,
+ typename __void_t<typename common_type<_Tp, _Up>::type>::type>
+{
+ typedef typename common_type<_Tp, _Up>::type type;
+};
+
template <class _Tp, class _Up, class ..._Vp>
struct __common_type_impl<__common_types<_Tp, _Up, _Vp...>,
typename __void_t<typename common_type<_Tp, _Up>::type>::type>
+ : __common_type_impl<
+ __common_types<typename common_type<_Tp, _Up>::type, _Vp...> >
{
- typedef typename common_type<
- typename common_type<_Tp, _Up>::type, _Vp...
- >::type type;
+
};
template <class _Tp, class _Up, class ..._Vp>