[libcxx] r214427 - [libcxx] Remove use of default function template parameters in type traits. Fixes DR20484
Eric Fiselier
eric at efcs.ca
Thu Jul 31 12:35:38 PDT 2014
Author: ericwf
Date: Thu Jul 31 14:35:37 2014
New Revision: 214427
URL: http://llvm.org/viewvc/llvm-project?rev=214427&view=rev
Log:
[libcxx] Remove use of default function template parameters in type traits. Fixes DR20484
Summary: This patch moves the SFINAE for __is_destructor_welformed out of the function template parameters. type_traits must compile in c++03 mode since it is included in c++03 headers.
Test Plan: No tests have been added.
Reviewers: danalbert, mclow.lists
Reviewed By: danalbert
Subscribers: K-ballo, cfe-commits
Differential Revision: http://reviews.llvm.org/D4735
Modified:
libcxx/branches/release_35/include/type_traits
Modified: libcxx/branches/release_35/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_35/include/type_traits?rev=214427&r1=214426&r2=214427&view=diff
==============================================================================
--- libcxx/branches/release_35/include/type_traits (original)
+++ libcxx/branches/release_35/include/type_traits Thu Jul 31 14:35:37 2014
@@ -1544,16 +1544,21 @@ template <class _Tp> struct _LIBCPP_TYPE
// Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed
// where _Up is remove_all_extents<_Tp>::type
+template <class>
+struct __is_destructible_apply { typedef int type; };
+
template <typename _Tp>
struct __is_destructor_wellformed {
- template <typename _Tp1, typename _Tp2 = decltype(_VSTD::declval<_Tp1&>().~_Tp1())>
- static char __test (int);
+ template <typename _Tp1>
+ static char __test (
+ typename __is_destructible_apply<decltype(_VSTD::declval<_Tp1&>().~_Tp1())>::type
+ );
template <typename _Tp1>
static __two __test (...);
static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char);
- };
+};
template <class _Tp, bool>
struct __destructible_imp;
More information about the cfe-commits
mailing list