type_traits (is_function): Support ref-qualified functions.
2013-06-13 Daniel Krugler <daniel.kruegler@gmail.com> * include/std/type_traits (is_function): Support ref-qualified functions. (is_copy_constructible, is_move_constructible, is_copy_assignable, is_move_assignable, is_nothrow_copy_constructible, is_nothrow_move_constructible, is_nothrow_copy_assignable, is_nothrow_move_assignable): Implement LWG 2196. (add_lvalue_reference, add_rvalue_reference, add_pointer): Implement LWG 2101. (__strip_reference_wrapper<<const reference_wrapper<_Tp>>): Remove, unused. * testsuite/20_util/add_lvalue_reference/value.cc: Extend. * testsuite/20_util/add_rvalue_reference/value.cc: Likewise. * testsuite/20_util/decay/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_assignable/value.cc: Likewise. * testsuite/20_util/is_constructible/value-2.cc: Likewise. * testsuite/20_util/is_copy_assignable/value.cc: Likewise. * testsuite/20_util/is_copy_constructible/value.cc: Likewise. * testsuite/20_util/is_function/value.cc: Likewise. * testsuite/20_util/is_move_assignable/value.cc: Likewise. * testsuite/20_util/is_move_constructible/value.cc: Likewise. * testsuite/20_util/is_nothrow_copy_assignable/value.cc: Likewise. * testsuite/20_util/is_nothrow_copy_constructible/value.cc: Likewise. * testsuite/20_util/is_nothrow_move_assignable/value.cc: Likewise. * testsuite/20_util/is_nothrow_move_constructible/value.cc: Likewise. * testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error line number. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. From-SVN: r200080
This commit is contained in:
parent
135faab69a
commit
8989803415
@ -1,3 +1,37 @@
|
||||
2013-06-13 Daniel Krugler <daniel.kruegler@gmail.com>
|
||||
|
||||
* include/std/type_traits (is_function): Support ref-qualified
|
||||
functions.
|
||||
(is_copy_constructible, is_move_constructible, is_copy_assignable,
|
||||
is_move_assignable, is_nothrow_copy_constructible,
|
||||
is_nothrow_move_constructible, is_nothrow_copy_assignable,
|
||||
is_nothrow_move_assignable): Implement LWG 2196.
|
||||
(add_lvalue_reference, add_rvalue_reference, add_pointer): Implement
|
||||
LWG 2101.
|
||||
(__strip_reference_wrapper<<const reference_wrapper<_Tp>>): Remove,
|
||||
unused.
|
||||
* testsuite/20_util/add_lvalue_reference/value.cc: Extend.
|
||||
* testsuite/20_util/add_rvalue_reference/value.cc: Likewise.
|
||||
* testsuite/20_util/decay/requirements/typedefs.cc: Likewise.
|
||||
* testsuite/20_util/is_assignable/value.cc: Likewise.
|
||||
* testsuite/20_util/is_constructible/value-2.cc: Likewise.
|
||||
* testsuite/20_util/is_copy_assignable/value.cc: Likewise.
|
||||
* testsuite/20_util/is_copy_constructible/value.cc: Likewise.
|
||||
* testsuite/20_util/is_function/value.cc: Likewise.
|
||||
* testsuite/20_util/is_move_assignable/value.cc: Likewise.
|
||||
* testsuite/20_util/is_move_constructible/value.cc: Likewise.
|
||||
* testsuite/20_util/is_nothrow_copy_assignable/value.cc: Likewise.
|
||||
* testsuite/20_util/is_nothrow_copy_constructible/value.cc: Likewise.
|
||||
* testsuite/20_util/is_nothrow_move_assignable/value.cc: Likewise.
|
||||
* testsuite/20_util/is_nothrow_move_constructible/value.cc: Likewise.
|
||||
|
||||
* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
|
||||
line number.
|
||||
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
|
||||
Likewise.
|
||||
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
|
||||
Likewise.
|
||||
|
||||
2013-06-13 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/tr1/modified_bessel_func.tcc (__gnu_cxx::__airy_ai(),
|
||||
|
@ -376,34 +376,98 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
struct is_function<_Res(_ArgTypes...)>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) &>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) &&>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......)>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) &>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) &&>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) const>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) const &>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) const &&>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) const>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) const &>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) const &&>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) volatile>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) volatile &>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) volatile &&>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) volatile>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) volatile &>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) volatile &&>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) const volatile>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) const volatile &>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes...) const volatile &&>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) const volatile>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) const volatile &>
|
||||
: public true_type { };
|
||||
|
||||
template<typename _Res, typename... _ArgTypes>
|
||||
struct is_function<_Res(_ArgTypes......) const volatile &&>
|
||||
: public true_type { };
|
||||
|
||||
template<typename>
|
||||
struct __is_null_pointer_helper
|
||||
: public false_type { };
|
||||
@ -482,6 +546,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
: public __is_member_pointer_helper<typename remove_cv<_Tp>::type>::type
|
||||
{ };
|
||||
|
||||
// Utility to detect referenceable types ([defns.referenceable]).
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_referenceable
|
||||
: public __or_<is_object<_Tp>, is_reference<_Tp>>::type
|
||||
{ };
|
||||
|
||||
template<typename _Res, typename... _Args>
|
||||
struct __is_referenceable<_Res(_Args...)>
|
||||
: public true_type
|
||||
{ };
|
||||
|
||||
template<typename _Res, typename... _Args>
|
||||
struct __is_referenceable<_Res(_Args......)>
|
||||
: public true_type
|
||||
{ };
|
||||
|
||||
// Type properties.
|
||||
|
||||
/// is_const
|
||||
@ -947,15 +1028,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
: public __is_constructible_impl<_Tp, _Args...>::type
|
||||
{ };
|
||||
|
||||
template<typename _Tp, bool = is_void<_Tp>::value>
|
||||
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
|
||||
struct __is_copy_constructible_impl;
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_copy_constructible_impl<_Tp, true>
|
||||
struct __is_copy_constructible_impl<_Tp, false>
|
||||
: public false_type { };
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_copy_constructible_impl<_Tp, false>
|
||||
struct __is_copy_constructible_impl<_Tp, true>
|
||||
: public is_constructible<_Tp, const _Tp&>
|
||||
{ };
|
||||
|
||||
@ -965,15 +1046,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
: public __is_copy_constructible_impl<_Tp>
|
||||
{ };
|
||||
|
||||
template<typename _Tp, bool = is_void<_Tp>::value>
|
||||
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
|
||||
struct __is_move_constructible_impl;
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_move_constructible_impl<_Tp, true>
|
||||
struct __is_move_constructible_impl<_Tp, false>
|
||||
: public false_type { };
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_move_constructible_impl<_Tp, false>
|
||||
struct __is_move_constructible_impl<_Tp, true>
|
||||
: public is_constructible<_Tp, _Tp&&>
|
||||
{ };
|
||||
|
||||
@ -1033,15 +1114,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
__is_nt_constructible_impl<_Tp, _Args...>>::type
|
||||
{ };
|
||||
|
||||
template<typename _Tp, bool = is_void<_Tp>::value>
|
||||
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
|
||||
struct __is_nothrow_copy_constructible_impl;
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_nothrow_copy_constructible_impl<_Tp, true>
|
||||
struct __is_nothrow_copy_constructible_impl<_Tp, false>
|
||||
: public false_type { };
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_nothrow_copy_constructible_impl<_Tp, false>
|
||||
struct __is_nothrow_copy_constructible_impl<_Tp, true>
|
||||
: public is_nothrow_constructible<_Tp, const _Tp&>
|
||||
{ };
|
||||
|
||||
@ -1051,15 +1132,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
: public __is_nothrow_copy_constructible_impl<_Tp>
|
||||
{ };
|
||||
|
||||
template<typename _Tp, bool = is_void<_Tp>::value>
|
||||
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
|
||||
struct __is_nothrow_move_constructible_impl;
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_nothrow_move_constructible_impl<_Tp, true>
|
||||
struct __is_nothrow_move_constructible_impl<_Tp, false>
|
||||
: public false_type { };
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_nothrow_move_constructible_impl<_Tp, false>
|
||||
struct __is_nothrow_move_constructible_impl<_Tp, true>
|
||||
: public is_nothrow_constructible<_Tp, _Tp&&>
|
||||
{ };
|
||||
|
||||
@ -1091,15 +1172,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
: public __is_assignable_helper<_Tp, _Up>::type
|
||||
{ };
|
||||
|
||||
template<typename _Tp, bool = is_void<_Tp>::value>
|
||||
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
|
||||
struct __is_copy_assignable_impl;
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_copy_assignable_impl<_Tp, true>
|
||||
struct __is_copy_assignable_impl<_Tp, false>
|
||||
: public false_type { };
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_copy_assignable_impl<_Tp, false>
|
||||
struct __is_copy_assignable_impl<_Tp, true>
|
||||
: public is_assignable<_Tp&, const _Tp&>
|
||||
{ };
|
||||
|
||||
@ -1109,15 +1190,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
: public __is_copy_assignable_impl<_Tp>
|
||||
{ };
|
||||
|
||||
template<typename _Tp, bool = is_void<_Tp>::value>
|
||||
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
|
||||
struct __is_move_assignable_impl;
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_move_assignable_impl<_Tp, true>
|
||||
struct __is_move_assignable_impl<_Tp, false>
|
||||
: public false_type { };
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_move_assignable_impl<_Tp, false>
|
||||
struct __is_move_assignable_impl<_Tp, true>
|
||||
: public is_assignable<_Tp&, _Tp&&>
|
||||
{ };
|
||||
|
||||
@ -1139,15 +1220,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
__is_nt_assignable_impl<_Tp, _Up>>::type
|
||||
{ };
|
||||
|
||||
template<typename _Tp, bool = is_void<_Tp>::value>
|
||||
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
|
||||
struct __is_nt_copy_assignable_impl;
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_nt_copy_assignable_impl<_Tp, true>
|
||||
struct __is_nt_copy_assignable_impl<_Tp, false>
|
||||
: public false_type { };
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_nt_copy_assignable_impl<_Tp, false>
|
||||
struct __is_nt_copy_assignable_impl<_Tp, true>
|
||||
: public is_nothrow_assignable<_Tp&, const _Tp&>
|
||||
{ };
|
||||
|
||||
@ -1157,15 +1238,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
: public __is_nt_copy_assignable_impl<_Tp>
|
||||
{ };
|
||||
|
||||
template<typename _Tp, bool = is_void<_Tp>::value>
|
||||
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
|
||||
struct __is_nt_move_assignable_impl;
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_nt_move_assignable_impl<_Tp, true>
|
||||
struct __is_nt_move_assignable_impl<_Tp, false>
|
||||
: public false_type { };
|
||||
|
||||
template<typename _Tp>
|
||||
struct __is_nt_move_assignable_impl<_Tp, false>
|
||||
struct __is_nt_move_assignable_impl<_Tp, true>
|
||||
: public is_nothrow_assignable<_Tp&, _Tp&&>
|
||||
{ };
|
||||
|
||||
@ -1373,30 +1454,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
struct remove_reference<_Tp&&>
|
||||
{ typedef _Tp type; };
|
||||
|
||||
template<typename _Tp,
|
||||
bool = __and_<__not_<is_reference<_Tp>>,
|
||||
__not_<is_void<_Tp>>>::value,
|
||||
bool = is_rvalue_reference<_Tp>::value>
|
||||
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
|
||||
struct __add_lvalue_reference_helper
|
||||
{ typedef _Tp type; };
|
||||
|
||||
template<typename _Tp>
|
||||
struct __add_lvalue_reference_helper<_Tp, true, false>
|
||||
struct __add_lvalue_reference_helper<_Tp, true>
|
||||
{ typedef _Tp& type; };
|
||||
|
||||
template<typename _Tp>
|
||||
struct __add_lvalue_reference_helper<_Tp, false, true>
|
||||
{ typedef typename remove_reference<_Tp>::type& type; };
|
||||
|
||||
/// add_lvalue_reference
|
||||
template<typename _Tp>
|
||||
struct add_lvalue_reference
|
||||
: public __add_lvalue_reference_helper<_Tp>
|
||||
{ };
|
||||
|
||||
template<typename _Tp,
|
||||
bool = __and_<__not_<is_reference<_Tp>>,
|
||||
__not_<is_void<_Tp>>>::value>
|
||||
template<typename _Tp, bool = __is_referenceable<_Tp>::value>
|
||||
struct __add_rvalue_reference_helper
|
||||
{ typedef _Tp type; };
|
||||
|
||||
@ -1654,10 +1726,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
{ };
|
||||
|
||||
/// add_pointer
|
||||
template<typename _Tp, bool = __or_<__is_referenceable<_Tp>,
|
||||
is_void<_Tp>>::value>
|
||||
struct __add_pointer_helper
|
||||
{ typedef _Tp type; };
|
||||
|
||||
template<typename _Tp>
|
||||
struct add_pointer
|
||||
struct __add_pointer_helper<_Tp, true>
|
||||
{ typedef typename remove_reference<_Tp>::type* type; };
|
||||
|
||||
template<typename _Tp>
|
||||
struct add_pointer
|
||||
: public __add_pointer_helper<_Tp>
|
||||
{ };
|
||||
|
||||
|
||||
template<std::size_t _Len>
|
||||
struct __aligned_storage_msa
|
||||
@ -1737,12 +1819,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||
typedef _Tp& __type;
|
||||
};
|
||||
|
||||
template<typename _Tp>
|
||||
struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
|
||||
{
|
||||
typedef _Tp& __type;
|
||||
};
|
||||
|
||||
template<typename _Tp>
|
||||
struct __decay_and_strip
|
||||
{
|
||||
|
@ -40,6 +40,10 @@ void test01()
|
||||
VERIFY( (is_same<add_lvalue_reference<ClassType&&>::type, ClassType&>::value) );
|
||||
VERIFY( (is_same<add_lvalue_reference<void>::type, void>::value) );
|
||||
VERIFY( (is_same<add_lvalue_reference<const void>::type, const void>::value) );
|
||||
VERIFY( (is_same<add_lvalue_reference<bool(int) const>::type, bool(int) const>::value) );
|
||||
VERIFY( (is_same<add_lvalue_reference<bool(int) &>::type, bool(int) &>::value) );
|
||||
VERIFY( (is_same<add_lvalue_reference<bool(int) const &&>::type, bool(int) const &&>::value) );
|
||||
VERIFY( (is_same<add_lvalue_reference<bool(int)>::type, bool(&)(int)>::value) );
|
||||
}
|
||||
|
||||
int main()
|
||||
|
@ -31,6 +31,7 @@ void test01()
|
||||
|
||||
VERIFY( (is_same<add_rvalue_reference<int>::type, int&&>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<int&&>::type, int&&>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<int&>::type, int&>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<const int>::type, const int&&>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<int*>::type, int*&&>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<ClassType&&>::type, ClassType&&>::value) );
|
||||
@ -38,6 +39,10 @@ void test01()
|
||||
VERIFY( (is_same<add_rvalue_reference<int(int)>::type, int(&&)(int)>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<void>::type, void>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<const void>::type, const void>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<bool(int) const>::type, bool(int) const>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<bool(int) &>::type, bool(int) &>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<bool(int) const &&>::type, bool(int) const &&>::value) );
|
||||
VERIFY( (is_same<add_rvalue_reference<bool(int)>::type, bool(&&)(int)>::value) );
|
||||
}
|
||||
|
||||
int main()
|
||||
|
@ -43,6 +43,10 @@ void test01()
|
||||
typedef void (fn_type) ();
|
||||
typedef decay<fn_type>::type test4_type;
|
||||
VERIFY( (is_same<test4_type, std::add_pointer<fn_type>::type>::value) );
|
||||
|
||||
typedef void (cfn_type) () const;
|
||||
typedef decay<cfn_type>::type test5_type;
|
||||
VERIFY( (is_same<test5_type, cfn_type>::value) );
|
||||
}
|
||||
|
||||
int main()
|
||||
|
@ -19,7 +19,7 @@
|
||||
// with this library; see the file COPYING3. If not see
|
||||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-error "static assertion failed" "" { target *-*-* } 1862 }
|
||||
// { dg-error "static assertion failed" "" { target *-*-* } 1938 }
|
||||
|
||||
#include <utility>
|
||||
|
||||
|
@ -277,8 +277,8 @@ static_assert(!std::is_assignable<DelAnyAssign&, int&>::value, "Error");
|
||||
static_assert(!std::is_assignable<DelAnyAssign&, const int&>::value, "Error");
|
||||
static_assert(!std::is_assignable<DelAnyAssign&, void>::value, "Error");
|
||||
static_assert(!std::is_assignable<DelAnyAssign&, void()>::value, "Error");
|
||||
// static_assert(!std::is_assignable<DelAnyAssign&, void()
|
||||
// const>::value, "Error");
|
||||
static_assert(!std::is_assignable<DelAnyAssign&,
|
||||
void() const>::value, "Error");
|
||||
static_assert(!std::is_assignable<DelAnyAssign&, void(&)()>::value, "Error");
|
||||
static_assert(!std::is_assignable<DelAnyAssign&, void(&&)()>::value, "Error");
|
||||
static_assert(!std::is_assignable<DelAnyAssign&,
|
||||
@ -580,6 +580,9 @@ static_assert(!std::is_assignable<const UAssignAll&,
|
||||
UAssignAll&>::value, "Error");
|
||||
static_assert(!std::is_assignable<const UAssignAll&, const
|
||||
UAssignAll&>::value, "Error");
|
||||
static_assert(!std::is_assignable<UAssignAll&, void() const>::value, "Error");
|
||||
static_assert(!std::is_assignable<UAssignAll&, void() &>::value, "Error");
|
||||
static_assert(!std::is_assignable<UAssignAll&, void() const volatile &&>::value, "Error");
|
||||
|
||||
static_assert(std::is_assignable<UAssignAll&, int>::value, "Error");
|
||||
static_assert(std::is_assignable<UAssignAll&, int&>::value, "Error");
|
||||
@ -600,7 +603,6 @@ static_assert(std::is_assignable<UAssignAll&,
|
||||
std::nullptr_t&>::value, "Error");
|
||||
static_assert(std::is_assignable<UAssignAll&, void()>::value, "Error");
|
||||
static_assert(std::is_assignable<UAssignAll&, void(&)()>::value, "Error");
|
||||
//static_assert(std::is_assignable<UAssignAll&, void() const>::value, "Error");
|
||||
static_assert(std::is_assignable<UAssignAll&, void(*)()>::value, "Error");
|
||||
static_assert(std::is_assignable<UAssignAll&, void(*&)()>::value, "Error");
|
||||
static_assert(std::is_assignable<UAssignAll&, int*>::value, "Error");
|
||||
@ -636,8 +638,8 @@ static_assert(!std::is_assignable<UDelAssignAll&,
|
||||
std::nullptr_t&>::value, "Error");
|
||||
static_assert(!std::is_assignable<UDelAssignAll&, void()>::value, "Error");
|
||||
static_assert(!std::is_assignable<UDelAssignAll&, void(&)()>::value, "Error");
|
||||
// static_assert(!std::is_assignable<UDelAssignAll&, void()
|
||||
// const>::value, "Error");
|
||||
static_assert(!std::is_assignable<UDelAssignAll&, void()
|
||||
const>::value, "Error");
|
||||
static_assert(!std::is_assignable<UDelAssignAll&, void(*)()>::value, "Error");
|
||||
static_assert(!std::is_assignable<UDelAssignAll&, void(*&)()>::value, "Error");
|
||||
static_assert(!std::is_assignable<UDelAssignAll&, int*>::value, "Error");
|
||||
|
@ -72,8 +72,8 @@ static_assert(!std::is_constructible<DelEllipsis, SE>::value, "Error");
|
||||
static_assert(!std::is_constructible<DelEllipsis, OpE>::value, "Error");
|
||||
static_assert(!std::is_constructible<DelEllipsis, OpSE>::value, "Error");
|
||||
static_assert(!std::is_constructible<DelEllipsis, void()>::value, "Error");
|
||||
// static_assert(!std::is_constructible<DelEllipsis, void() const>::value,
|
||||
// "Error");
|
||||
static_assert(!std::is_constructible<DelEllipsis, void() const>::value,
|
||||
"Error");
|
||||
static_assert(!std::is_constructible<DelEllipsis, int[1]>::value, "Error");
|
||||
static_assert(!std::is_constructible<DelEllipsis, int[]>::value, "Error");
|
||||
static_assert(!std::is_constructible<DelEllipsis, int*>::value, "Error");
|
||||
@ -461,20 +461,20 @@ static_assert(!std::is_constructible<OpSE, void()>::value, "Error");
|
||||
static_assert(!std::is_constructible<int[], void()>::value, "Error");
|
||||
static_assert(!std::is_constructible<int[1], void()>::value, "Error");
|
||||
|
||||
// static_assert(!std::is_constructible<void(int) const,
|
||||
// void() const>::value, "Error");
|
||||
// static_assert(!std::is_constructible<int, void() const>::value, "Error");
|
||||
// static_assert(!std::is_constructible<Abstract, void() const>::value, "Error");
|
||||
// static_assert(!std::is_constructible<std::nullptr_t, void() const>::value,
|
||||
// "Error");
|
||||
// static_assert(!std::is_constructible<Empty, void() const>::value, "Error");
|
||||
// static_assert(!std::is_constructible<U, void() const>::value, "Error");
|
||||
// static_assert(!std::is_constructible<E, void() const>::value, "Error");
|
||||
// static_assert(!std::is_constructible<SE, void() const>::value, "Error");
|
||||
// static_assert(!std::is_constructible<OpE, void() const>::value, "Error");
|
||||
// static_assert(!std::is_constructible<OpSE, void() const>::value, "Error");
|
||||
// static_assert(!std::is_constructible<int[], void() const>::value, "Error");
|
||||
// static_assert(!std::is_constructible<int[1], void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<void(int) const,
|
||||
void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<int, void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<Abstract, void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<std::nullptr_t, void() const>::value,
|
||||
"Error");
|
||||
static_assert(!std::is_constructible<Empty, void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<U, void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<E, void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<SE, void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<OpE, void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<OpSE, void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<int[], void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<int[1], void() const>::value, "Error");
|
||||
|
||||
static_assert(!std::is_constructible<void, int, int>::value, "Error");
|
||||
static_assert(!std::is_constructible<void, Empty, B>::value, "Error");
|
||||
@ -488,8 +488,8 @@ static_assert(!std::is_constructible<void, int[], int[]>::value, "Error");
|
||||
static_assert(!std::is_constructible<void, void, int>::value, "Error");
|
||||
static_assert(!std::is_constructible<void, void, void>::value, "Error");
|
||||
static_assert(!std::is_constructible<void, void(), void()>::value, "Error");
|
||||
// static_assert(!std::is_constructible<void, void() const,
|
||||
// void() volatile>::value, "Error");
|
||||
static_assert(!std::is_constructible<void, void() const,
|
||||
void() volatile>::value, "Error");
|
||||
|
||||
static_assert(!std::is_constructible<int, int, int>::value, "Error");
|
||||
static_assert(!std::is_constructible<const int, int, int>::value, "Error");
|
||||
@ -651,13 +651,13 @@ static_assert(!std::is_constructible<void(), void, void>::value, "Error");
|
||||
static_assert(!std::is_constructible<void(), void(), int>::value, "Error");
|
||||
static_assert(!std::is_constructible<void(), void(), void()>::value, "Error");
|
||||
|
||||
// static_assert(!std::is_constructible<void() const, int, int>::value, "Error");
|
||||
// static_assert(!std::is_constructible<void() const, void, int>::value, "Error");
|
||||
// static_assert(!std::is_constructible<void() const, void, void>::value, "Error");
|
||||
// static_assert(!std::is_constructible<void() const, void() volatile,
|
||||
// int>::value, "Error");
|
||||
// static_assert(!std::is_constructible<void() const, void() volatile const,
|
||||
// void() const>::value, "Error");
|
||||
static_assert(!std::is_constructible<void() const, int, int>::value, "Error");
|
||||
static_assert(!std::is_constructible<void() const, void, int>::value, "Error");
|
||||
static_assert(!std::is_constructible<void() const, void, void>::value, "Error");
|
||||
static_assert(!std::is_constructible<void() const, void() volatile,
|
||||
int>::value, "Error");
|
||||
static_assert(!std::is_constructible<void() const, void() volatile const,
|
||||
void() const>::value, "Error");
|
||||
|
||||
static_assert(!std::is_constructible<FromArgs<int>, int, int>::value, "Error");
|
||||
static_assert(!std::is_constructible<const FromArgs<int>, int, int>::value,
|
||||
|
@ -52,6 +52,14 @@ void test01()
|
||||
int (ClassType::*[2][3])>(false)) );
|
||||
VERIFY( (test_property<is_copy_assignable,
|
||||
int (ClassType::*[][2][3]) (int)>(false)) );
|
||||
VERIFY( (test_property<is_copy_assignable,
|
||||
ClassType(unsigned) const &>(false)) );
|
||||
VERIFY( (test_property<is_copy_assignable,
|
||||
bool(ClassType) const>(false)) );
|
||||
VERIFY( (test_property<is_copy_assignable,
|
||||
bool(...) &&>(false)) );
|
||||
VERIFY( (test_property<is_copy_assignable,
|
||||
EnumType(int, ...)>(false)) );
|
||||
|
||||
VERIFY( (test_property<is_copy_assignable, NoexceptMoveAssignClass>(false)) );
|
||||
VERIFY( (test_property<is_copy_assignable, ExceptMoveAssignClass>(false)) );
|
||||
|
@ -61,6 +61,14 @@ void test01()
|
||||
int (ClassType::*[2][3])>(false)) );
|
||||
VERIFY( (test_category<is_copy_constructible,
|
||||
int (ClassType::*[][2][3]) (int)>(false)) );
|
||||
VERIFY( (test_category<is_copy_constructible,
|
||||
ClassType(unsigned) const &>(false)) );
|
||||
VERIFY( (test_category<is_copy_constructible,
|
||||
bool(ClassType) const>(false)) );
|
||||
VERIFY( (test_category<is_copy_constructible,
|
||||
bool(...) &&>(false)) );
|
||||
VERIFY( (test_category<is_copy_constructible,
|
||||
EnumType(int, ...)>(false)) );
|
||||
|
||||
VERIFY( (test_property<is_copy_constructible,
|
||||
volatile NoexceptCopyConsClass>(false)) );
|
||||
|
@ -32,6 +32,9 @@ void test01()
|
||||
VERIFY( (test_category<is_function, ClassType (ClassType)>(true)) );
|
||||
VERIFY( (test_category<is_function, float (int, float, int[], int&)>(true)) );
|
||||
VERIFY( (test_category<is_function, int (int, ...)>(true)) );
|
||||
VERIFY( (test_category<is_function, bool (ClassType) const>(true)) );
|
||||
VERIFY( (test_category<is_function, ClassType () &>(true)) );
|
||||
VERIFY( (test_category<is_function, char (int, ClassType) const volatile &&>(true)) );
|
||||
|
||||
// Negative tests.
|
||||
VERIFY( (test_category<is_function, int&>(false)) );
|
||||
|
@ -54,6 +54,14 @@ void test01()
|
||||
int (ClassType::*[2][3])>(false)) );
|
||||
VERIFY( (test_property<is_move_assignable,
|
||||
int (ClassType::*[][2][3]) (int)>(false)) );
|
||||
VERIFY( (test_property<is_move_assignable,
|
||||
ClassType(unsigned) const &>(false)) );
|
||||
VERIFY( (test_property<is_move_assignable,
|
||||
bool(ClassType) const>(false)) );
|
||||
VERIFY( (test_property<is_move_assignable,
|
||||
bool(...) &&>(false)) );
|
||||
VERIFY( (test_property<is_move_assignable,
|
||||
EnumType(int, ...)>(false)) );
|
||||
|
||||
VERIFY( (test_property<is_move_assignable, DeletedCopyAssignClass>(false)) );
|
||||
VERIFY( (test_property<is_move_assignable, DeletedMoveAssignClass>(false)) );
|
||||
|
@ -59,6 +59,14 @@ void test01()
|
||||
int (ClassType::*[2][3])>(false)) );
|
||||
VERIFY( (test_category<is_move_constructible,
|
||||
int (ClassType::*[][2][3]) (int)>(false)) );
|
||||
VERIFY( (test_category<is_move_constructible,
|
||||
ClassType(unsigned) const &>(false)) );
|
||||
VERIFY( (test_category<is_move_constructible,
|
||||
bool(ClassType) const>(false)) );
|
||||
VERIFY( (test_category<is_move_constructible,
|
||||
bool(...) &&>(false)) );
|
||||
VERIFY( (test_category<is_move_constructible,
|
||||
EnumType(int, ...)>(false)) );
|
||||
|
||||
VERIFY( (test_property<is_move_constructible,
|
||||
const NoexceptMoveConsClass>(false)) );
|
||||
|
@ -55,6 +55,14 @@ void test01()
|
||||
int (ClassType::*[2][3])>(false)) );
|
||||
VERIFY( (test_property<is_nothrow_copy_assignable,
|
||||
int (ClassType::*[][2][3]) (int)>(false)) );
|
||||
VERIFY( (test_property<is_nothrow_copy_assignable,
|
||||
ClassType(unsigned) const &>(false)) );
|
||||
VERIFY( (test_property<is_nothrow_copy_assignable,
|
||||
bool(ClassType) const>(false)) );
|
||||
VERIFY( (test_property<is_nothrow_copy_assignable,
|
||||
bool(...) &&>(false)) );
|
||||
VERIFY( (test_property<is_nothrow_copy_assignable,
|
||||
EnumType(int, ...)>(false)) );
|
||||
|
||||
VERIFY( (test_property<is_nothrow_copy_assignable,
|
||||
ExceptCopyAssignClass>(false)) );
|
||||
|
@ -58,6 +58,14 @@ void test01()
|
||||
int (ClassType::*[2][3])>(false)) );
|
||||
VERIFY( (test_category<is_nothrow_copy_constructible,
|
||||
int (ClassType::*[][2][3]) (int)>(false)) );
|
||||
VERIFY( (test_category<is_nothrow_copy_constructible,
|
||||
ClassType(unsigned) const &>(false)) );
|
||||
VERIFY( (test_category<is_nothrow_copy_constructible,
|
||||
bool(ClassType) const>(false)) );
|
||||
VERIFY( (test_category<is_nothrow_copy_constructible,
|
||||
bool(...) &&>(false)) );
|
||||
VERIFY( (test_category<is_nothrow_copy_constructible,
|
||||
EnumType(int, ...)>(false)) );
|
||||
|
||||
VERIFY( (test_property<is_nothrow_copy_constructible,
|
||||
volatile NoexceptCopyConsClass>(false)) );
|
||||
|
@ -57,6 +57,14 @@ void test01()
|
||||
int (ClassType::*[2][3])>(false)) );
|
||||
VERIFY( (test_property<is_nothrow_move_assignable,
|
||||
int (ClassType::*[][2][3]) (int)>(false)) );
|
||||
VERIFY( (test_property<is_nothrow_move_assignable,
|
||||
ClassType(unsigned) const &>(false)) );
|
||||
VERIFY( (test_property<is_nothrow_move_assignable,
|
||||
bool(ClassType) const>(false)) );
|
||||
VERIFY( (test_property<is_nothrow_move_assignable,
|
||||
bool(...) &&>(false)) );
|
||||
VERIFY( (test_property<is_nothrow_move_assignable,
|
||||
EnumType(int, ...)>(false)) );
|
||||
|
||||
VERIFY( (test_property<is_nothrow_move_assignable,
|
||||
ExceptMoveAssignClass>(false)) );
|
||||
|
@ -55,6 +55,14 @@ void test01()
|
||||
int (ClassType::*[2][3])>(false)) );
|
||||
VERIFY( (test_category<is_nothrow_move_constructible,
|
||||
int (ClassType::*[][2][3]) (int)>(false)) );
|
||||
VERIFY( (test_category<is_nothrow_move_constructible,
|
||||
ClassType(unsigned) const &>(false)) );
|
||||
VERIFY( (test_category<is_nothrow_move_constructible,
|
||||
bool(ClassType) const>(false)) );
|
||||
VERIFY( (test_category<is_nothrow_move_constructible,
|
||||
bool(...) &&>(false)) );
|
||||
VERIFY( (test_category<is_nothrow_move_constructible,
|
||||
EnumType(int, ...)>(false)) );
|
||||
|
||||
VERIFY( (test_property<is_nothrow_move_constructible,
|
||||
const NoexceptMoveConsClass>(false)) );
|
||||
|
@ -48,5 +48,5 @@ void test01()
|
||||
// { dg-error "required from here" "" { target *-*-* } 40 }
|
||||
// { dg-error "required from here" "" { target *-*-* } 42 }
|
||||
|
||||
// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1604 }
|
||||
// { dg-error "declaration of" "" { target *-*-* } 1568 }
|
||||
// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1676 }
|
||||
// { dg-error "declaration of" "" { target *-*-* } 1640 }
|
||||
|
@ -48,5 +48,5 @@ void test01()
|
||||
// { dg-error "required from here" "" { target *-*-* } 40 }
|
||||
// { dg-error "required from here" "" { target *-*-* } 42 }
|
||||
|
||||
// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1522 }
|
||||
// { dg-error "declaration of" "" { target *-*-* } 1486 }
|
||||
// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1594 }
|
||||
// { dg-error "declaration of" "" { target *-*-* } 1558 }
|
||||
|
Loading…
Reference in New Issue
Block a user