diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -544,6 +544,18 @@ // is_same +#if __has_keyword(__is_same) + +template +struct _LIBCPP_TEMPLATE_VIS is_same : _BoolConstant<__is_same(_Tp, _Up)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_same_v = __is_same(_Tp, _Up); +#endif + +#else + template struct _LIBCPP_TEMPLATE_VIS is_same : public false_type {}; template struct _LIBCPP_TEMPLATE_VIS is_same<_Tp, _Tp> : public true_type {}; @@ -553,6 +565,8 @@ = is_same<_Tp, _Up>::value; #endif +#endif // __is_same + template using _IsSame = _BoolConstant< #ifdef __clang__ @@ -656,6 +670,18 @@ // is_const +#if __has_keyword(__is_const) + +template +struct _LIBCPP_TEMPLATE_VIS is_const : _BoolConstant<__is_const(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_const_v = __is_const(_Tp); +#endif + +#else + template struct _LIBCPP_TEMPLATE_VIS is_const : public false_type {}; template struct _LIBCPP_TEMPLATE_VIS is_const<_Tp const> : public true_type {}; @@ -665,8 +691,22 @@ = is_const<_Tp>::value; #endif +#endif // __has_keyword(__is_const) + // is_volatile +#if __has_keyword(__is_volatile) + +template +struct _LIBCPP_TEMPLATE_VIS is_volatile : _BoolConstant<__is_volatile(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_volatile_v = __is_volatile(_Tp); +#endif + +#else + template struct _LIBCPP_TEMPLATE_VIS is_volatile : public false_type {}; template struct _LIBCPP_TEMPLATE_VIS is_volatile<_Tp volatile> : public true_type {}; @@ -676,37 +716,87 @@ = is_volatile<_Tp>::value; #endif +#endif // __has_keyword(__is_volatile) + // remove_const +#if __has_keyword(__remove_const) + +template +struct _LIBCPP_TEMPLATE_VIS remove_const {typedef __remove_const(_Tp) type;}; + +#if _LIBCPP_STD_VER > 11 +template using remove_const_t = __remove_const(_Tp); +#endif + +#else + template struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;}; #if _LIBCPP_STD_VER > 11 template using remove_const_t = typename remove_const<_Tp>::type; #endif +#endif // __has_keyword(__remove_const) + // remove_volatile +#if __has_keyword(__remove_volatile) + +template +struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef __remove_volatile(_Tp) type;}; + +#if _LIBCPP_STD_VER > 11 +template using remove_volatile_t = __remove_volatile(_Tp); +#endif + +#else + template struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;}; #if _LIBCPP_STD_VER > 11 template using remove_volatile_t = typename remove_volatile<_Tp>::type; #endif +#endif // __has_keyword(__remove_volatile) + // remove_cv +#if __has_keyword(__remove_cv) + +template +struct _LIBCPP_TEMPLATE_VIS remove_cv {typedef __remove_cv(_Tp) type;}; + +#if _LIBCPP_STD_VER > 11 +template using remove_cv_t = __remove_cv(_Tp); +#endif + +#else + template struct _LIBCPP_TEMPLATE_VIS remove_cv {typedef typename remove_volatile::type>::type type;}; #if _LIBCPP_STD_VER > 11 template using remove_cv_t = typename remove_cv<_Tp>::type; #endif +#endif // __has_keyword(__remove_cv) + // is_void -template struct __libcpp_is_void : public false_type {}; -template <> struct __libcpp_is_void : public true_type {}; +#if __has_keyword(__is_void) + +template +struct _LIBCPP_TEMPLATE_VIS is_void : _BoolConstant<__is_void(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_void_v = __is_void(_Tp); +#endif + +#else template struct _LIBCPP_TEMPLATE_VIS is_void - : public __libcpp_is_void::type> {}; + : public is_same {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template @@ -714,6 +804,8 @@ = is_void<_Tp>::value; #endif +#endif // __has_keyword(__is_void) + // __is_nullptr_t template struct __is_nullptr_t_impl : public false_type {}; @@ -735,6 +827,18 @@ // is_integral +#if __has_keyword(__is_integral) + +template +struct _LIBCPP_TEMPLATE_VIS is_integral : _BoolConstant<__is_integral(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_integral_v = __is_integral(_Tp); +#endif + +#else + template struct _LIBCPP_TEMPLATE_VIS is_integral : public _BoolConstant<__libcpp_is_integral::type>::value> {}; @@ -744,8 +848,22 @@ = is_integral<_Tp>::value; #endif +#endif // __has_keyword(__is_integral) + // is_floating_point +#if __has_keyword(__is_floating_point) + +template +struct _LIBCPP_TEMPLATE_VIS is_floating_point : _BoolConstant<__is_floating_point(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_floating_point_v = __is_floating_point(_Tp); +#endif + +#else + template struct __libcpp_is_floating_point : public false_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; template <> struct __libcpp_is_floating_point : public true_type {}; @@ -760,8 +878,22 @@ = is_floating_point<_Tp>::value; #endif +#endif // __has_keyword(__is_floating_point) + // is_array +#if __has_keyword(__is_array) + +template +struct _LIBCPP_TEMPLATE_VIS is_array : _BoolConstant<__is_array(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_array_v = __is_array(_Tp); +#endif + +#else + template struct _LIBCPP_TEMPLATE_VIS is_array : public false_type {}; template struct _LIBCPP_TEMPLATE_VIS is_array<_Tp[]> @@ -775,6 +907,8 @@ = is_array<_Tp>::value; #endif +#endif // __has_keyword(__is_array) + // is_pointer template struct __libcpp_is_pointer : public false_type {}; @@ -788,6 +922,18 @@ template struct __libcpp_remove_objc_qualifiers<_Tp __unsafe_unretained> { typedef _Tp type; }; #endif +#if __has_keyword(__is_pointer) + +template +struct _LIBCPP_TEMPLATE_VIS is_pointer : _BoolConstant<__is_pointer(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_pointer_v = __is_pointer(_Tp); +#endif + +#else // __has_keyword(__is_pointer) + template struct _LIBCPP_TEMPLATE_VIS is_pointer : public __libcpp_is_pointer::type>::type> {}; @@ -797,8 +943,36 @@ = is_pointer<_Tp>::value; #endif +#endif // __has_keyword(__is_pointer) + // is_reference +#if __has_keyword(__is_lvalue_reference) && \ + __has_keyword(__is_rvalue_reference) && \ + __has_keyword(__is_reference) + +template +struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : _BoolConstant<__is_lvalue_reference(_Tp)> { }; + +template +struct _LIBCPP_TEMPLATE_VIS is_rvalue_reference : _BoolConstant<__is_rvalue_reference(_Tp)> { }; + +template +struct _LIBCPP_TEMPLATE_VIS is_reference : _BoolConstant<__is_reference(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_reference_v = __is_reference(_Tp); + +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_lvalue_reference_v = __is_lvalue_reference(_Tp); + +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_rvalue_reference_v = __is_rvalue_reference(_Tp); +#endif + +#else // __has_keyword(__is_lvalue_reference) && etc... + template struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference : public false_type {}; template struct _LIBCPP_TEMPLATE_VIS is_lvalue_reference<_Tp&> : public true_type {}; @@ -822,6 +996,9 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_rvalue_reference_v = is_rvalue_reference<_Tp>::value; #endif + +#endif // __has_keyword(__is_lvalue_reference) && etc... + // is_union #if __has_feature(is_union) || defined(_LIBCPP_COMPILER_GCC) @@ -902,6 +1079,19 @@ }; }; +#if __has_keyword(__is_member_function_pointer) + +template +struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer + : _BoolConstant<__is_member_function_pointer(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_member_function_pointer_v + = __is_member_function_pointer(_Tp); +#endif + +#else // __has_keyword(__is_member_function_pointer) template struct _LIBCPP_TEMPLATE_VIS is_member_function_pointer : public _BoolConstant< __libcpp_is_member_pointer::type>::__is_func > {}; @@ -912,8 +1102,22 @@ = is_member_function_pointer<_Tp>::value; #endif +#endif // __has_keyword(__is_member_function_pointer) + // is_member_pointer +#if __has_keyword(__is_member_pointer) + +template +struct _LIBCPP_TEMPLATE_VIS is_member_pointer : _BoolConstant<__is_member_pointer(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_member_pointer_v = __is_member_pointer(_Tp); +#endif + +#else // __has_keyword(__is_member_pointer) + template struct _LIBCPP_TEMPLATE_VIS is_member_pointer : public _BoolConstant< __libcpp_is_member_pointer::type>::__is_member > {}; @@ -923,8 +1127,24 @@ = is_member_pointer<_Tp>::value; #endif +#endif // __has_keyword(__is_member_pointer) + // is_member_object_pointer +#if __has_keyword(__is_member_object_pointer) + +template +struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer + : _BoolConstant<__is_member_object_pointer(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_member_object_pointer_v + = __is_member_object_pointer(_Tp); +#endif + +#else // __has_keyword(__is_member_object_pointer) + template struct _LIBCPP_TEMPLATE_VIS is_member_object_pointer : public _BoolConstant< __libcpp_is_member_pointer::type>::__is_obj > {}; @@ -934,6 +1154,8 @@ = is_member_object_pointer<_Tp>::value; #endif +#endif // __has_keyword(__is_member_object_pointer) + // is_enum #if __has_feature(is_enum) || defined(_LIBCPP_COMPILER_GCC) @@ -941,6 +1163,11 @@ template struct _LIBCPP_TEMPLATE_VIS is_enum : public integral_constant {}; +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_enum_v = __is_enum(_Tp); +#endif + #else template struct _LIBCPP_TEMPLATE_VIS is_enum @@ -955,16 +1182,28 @@ !is_class<_Tp>::value && !is_function<_Tp>::value > {}; -#endif - #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_enum_v = is_enum<_Tp>::value; #endif +#endif // __has_feature(is_enum) || defined(_LIBCPP_COMPILER_GCC) + // is_arithmetic +#if __has_keyword(__is_arithmetic) + +template +struct _LIBCPP_TEMPLATE_VIS is_arithmetic : _BoolConstant<__is_arithmetic(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_arithmetic_v = __is_arithmetic(_Tp); +#endif + +#else // __has_keyword(__is_arithmetic) + template struct _LIBCPP_TEMPLATE_VIS is_arithmetic : public integral_constant::value || is_floating_point<_Tp>::value> {}; @@ -975,8 +1214,23 @@ = is_arithmetic<_Tp>::value; #endif +#endif // __has_keyword(__is_arithmetic) + // is_fundamental +// In clang 9 and lower, this builtin did not work for nullptr_t +#if __has_keyword(__is_fundamental) && _LIBCPP_CLANG_VER > 900 + +template +struct _LIBCPP_TEMPLATE_VIS is_fundamental : _BoolConstant<__is_fundamental(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_fundamental_v = __is_fundamental(_Tp); +#endif + +#else // __has_keyword(__is_fundamental) + template struct _LIBCPP_TEMPLATE_VIS is_fundamental : public integral_constant::value || __is_nullptr_t<_Tp>::value || @@ -988,8 +1242,23 @@ = is_fundamental<_Tp>::value; #endif +#endif // __has_keyword(__is_fundamental) + // is_scalar +// >= 11 because in C++03 nullptr isn't actually nullptr +#if __has_keyword(__is_scalar) && !defined(_LIBCPP_CXX03_LANG) + +template +struct _LIBCPP_TEMPLATE_VIS is_scalar : _BoolConstant<__is_scalar(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_scalar_v = __is_scalar(_Tp); +#endif + +#else // __has_keyword(__is_scalar) + template struct __is_block : false_type {}; #if defined(_LIBCPP_HAS_EXTENSION_BLOCKS) template struct __is_block<_Rp (^)(_Args...)> : true_type {}; @@ -1011,8 +1280,22 @@ = is_scalar<_Tp>::value; #endif +#endif // __has_keyword(__is_scalar) + // is_object +#if __has_keyword(__is_object) + +template +struct _LIBCPP_TEMPLATE_VIS is_object : _BoolConstant<__is_object(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_object_v = __is_object(_Tp); +#endif + +#else // __has_keyword(__is_object) + template struct _LIBCPP_TEMPLATE_VIS is_object : public integral_constant::value || is_array<_Tp>::value || @@ -1025,8 +1308,23 @@ = is_object<_Tp>::value; #endif +#endif // __has_keyword(__is_object) + // is_compound +// >= 11 because in C++03 nullptr isn't actually nullptr +#if __has_keyword(__is_compound) && !defined(_LIBCPP_CXX03_LANG) + +template +struct _LIBCPP_TEMPLATE_VIS is_compound : _BoolConstant<__is_compound(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_compound_v = __is_compound(_Tp); +#endif + +#else // __has_keyword(__is_compound) + template struct _LIBCPP_TEMPLATE_VIS is_compound : public integral_constant::value> {}; @@ -1036,6 +1334,7 @@ = is_compound<_Tp>::value; #endif +#endif // __has_keyword(__is_compound) // __is_referenceable [defns.referenceable] @@ -1080,6 +1379,13 @@ // remove_reference +#if __has_keyword(__remove_reference) + +template +struct _LIBCPP_TEMPLATE_VIS remove_reference { typedef __remove_reference(_Tp) type; }; + +#else // __has_keyword(__remove_reference) + template struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG_TYPE _Tp type;}; @@ -1088,6 +1394,8 @@ template using remove_reference_t = typename remove_reference<_Tp>::type; #endif +#endif // __has_keyword(__remove_reference) + // add_lvalue_reference template ::value> struct __add_lvalue_reference_impl { typedef _LIBCPP_NODEBUG_TYPE _Tp type; }; @@ -1195,6 +1503,19 @@ // is_signed +// In clang 9 and earlier, this builtin did not work for floating points or enums +#if __has_keyword(__is_signed) && _LIBCPP_CLANG_VER > 900 + +template +struct _LIBCPP_TEMPLATE_VIS is_signed : _BoolConstant<__is_signed(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_signed_v = __is_signed(_Tp); +#endif + +#else // __has_keyword(__is_signed) + template ::value> struct __libcpp_is_signed_impl : public _LIBCPP_BOOL_CONSTANT(_Tp(-1) < _Tp(0)) {}; @@ -1214,8 +1535,22 @@ = is_signed<_Tp>::value; #endif +#endif // __has_keyword(__is_signed) + // is_unsigned +#if __has_keyword(__is_unsigned) + +template +struct _LIBCPP_TEMPLATE_VIS is_unsigned : _BoolConstant<__is_unsigned(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_unsigned_v = __is_unsigned(_Tp); +#endif + +#else // __has_keyword(__is_unsigned) + template ::value> struct __libcpp_is_unsigned_impl : public _LIBCPP_BOOL_CONSTANT(_Tp(0) < _Tp(-1)) {}; @@ -1235,6 +1570,8 @@ = is_unsigned<_Tp>::value; #endif +#endif // __has_keyword(__is_unsigned) + // rank template struct _LIBCPP_TEMPLATE_VIS rank @@ -1252,6 +1589,19 @@ // extent +#if __has_keyword(__array_extent) + +template +struct _LIBCPP_TEMPLATE_VIS extent + : integral_constant { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR size_t extent_v = __array_extent(_Tp, _Ip); +#endif + +#else // __has_keyword(__array_extent) + template struct _LIBCPP_TEMPLATE_VIS extent : public integral_constant {}; template struct _LIBCPP_TEMPLATE_VIS extent<_Tp[], 0> @@ -1269,6 +1619,8 @@ = extent<_Tp, _Ip>::value; #endif +#endif // __has_keyword(__array_extent) + // remove_extent template struct _LIBCPP_TEMPLATE_VIS remove_extent @@ -2114,6 +2466,18 @@ template struct __select_2nd { typedef _LIBCPP_NODEBUG_TYPE _Tp type; }; +#if __has_keyword(__is_assignable) + +template +struct _LIBCPP_TEMPLATE_VIS is_assignable : _BoolConstant<__is_assignable(_Tp, _Up)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_assignable_v = __is_assignable(_Tp, _Arg); +#endif + +#else // __has_keyword(__is_assignable) + template typename __select_2nd() = _VSTD::declval<_Arg>())), true_type>::type __is_assignable_test(int); @@ -2142,6 +2506,8 @@ = is_assignable<_Tp, _Arg>::value; #endif +#endif // __has_keyword(__is_assignable) + // is_copy_assignable template struct _LIBCPP_TEMPLATE_VIS is_copy_assignable @@ -2168,6 +2534,18 @@ // is_destructible +#if __has_keyword(__is_destructible) + +template +struct _LIBCPP_TEMPLATE_VIS is_destructible : _BoolConstant<__is_destructible(_Tp)> { }; + +#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) +template +_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_destructible_v = __is_destructible(_Tp); +#endif + +#else // __has_keyword(__is_destructible) + // if it's a reference, return true // if it's a function, return false // if it's void, return false @@ -2230,6 +2608,8 @@ = is_destructible<_Tp>::value; #endif +#endif // __has_keyword(__is_destructible) + // move template @@ -3859,7 +4239,6 @@ template using underlying_type_t = typename underlying_type<_Tp>::type; #endif - template ::value> struct __sfinae_underlying_type { diff --git a/libcxx/test/std/utilities/meta/meta.rel/is_same.pass.cpp b/libcxx/test/std/utilities/meta/meta.rel/is_same.pass.cpp --- a/libcxx/test/std/utilities/meta/meta.rel/is_same.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.rel/is_same.pass.cpp @@ -50,6 +50,14 @@ static_assert((!std::is_same::value), ""); } +template +struct OverloadTest +{ + void fn(std::is_same) { } + void fn(std::false_type) { } + void x() { fn(std::false_type()); } +}; + class Class { public: @@ -70,5 +78,8 @@ test_is_not_same(); test_is_not_same(); + OverloadTest t; + (void)t; + return 0; }