diff options
author | Daniel Kruegler <daniel.kruegler@gmail.com> | 2013-06-13 23:18:27 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-06-13 23:18:27 +0000 |
commit | 8989803415aa72e38be56ea6d31ff240a1568ce1 (patch) | |
tree | 41568700afc1e3357414f602caaee3f83b7a35b0 /libstdc++-v3 | |
parent | 135faab69ac610c1c9d2e0228ed682222094b6ac (diff) | |
download | gcc-8989803415aa72e38be56ea6d31ff240a1568ce1.zip gcc-8989803415aa72e38be56ea6d31ff240a1568ce1.tar.gz gcc-8989803415aa72e38be56ea6d31ff240a1568ce1.tar.bz2 |
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
Diffstat (limited to 'libstdc++-v3')
19 files changed, 270 insertions, 78 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 40c1450..d90525d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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(), diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 99d0a5b..eef9df6 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -377,33 +377,97 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : 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 @@ -1738,12 +1820,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; template<typename _Tp> - struct __strip_reference_wrapper<const reference_wrapper<_Tp> > - { - typedef _Tp& __type; - }; - - template<typename _Tp> struct __decay_and_strip { typedef typename __strip_reference_wrapper< diff --git a/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc index aaa28a3..152f03a 100644 --- a/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc +++ b/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc @@ -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() diff --git a/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc index 556b78e..7dcb1dc 100644 --- a/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc +++ b/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc @@ -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() diff --git a/libstdc++-v3/testsuite/20_util/decay/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/decay/requirements/typedefs.cc index 48236af..51b2c5f 100644 --- a/libstdc++-v3/testsuite/20_util/decay/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/decay/requirements/typedefs.cc @@ -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() diff --git a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc index 5b5a8eb..1aeba82 100644 --- a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc +++ b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc @@ -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> diff --git a/libstdc++-v3/testsuite/20_util/is_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_assignable/value.cc index 8d45671..396b245 100644 --- a/libstdc++-v3/testsuite/20_util/is_assignable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_assignable/value.cc @@ -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"); diff --git a/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc b/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc index f311911..1a6f264 100644 --- a/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc +++ b/libstdc++-v3/testsuite/20_util/is_constructible/value-2.cc @@ -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, diff --git a/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc index bad1a08..af5e3ba 100644 --- a/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc @@ -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)) ); diff --git a/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc index 0fe00d2..0a9686d 100644 --- a/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc @@ -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)) ); diff --git a/libstdc++-v3/testsuite/20_util/is_function/value.cc b/libstdc++-v3/testsuite/20_util/is_function/value.cc index 6e88e77..ce52ac9 100644 --- a/libstdc++-v3/testsuite/20_util/is_function/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_function/value.cc @@ -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)) ); diff --git a/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc index ab2d493..c96f739 100644 --- a/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc @@ -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)) ); diff --git a/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc index edda594..94af3e1 100644 --- a/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc @@ -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)) ); diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc index 969b130..72ce0a0 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc @@ -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)) ); diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc index 5417479..33d82af 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc @@ -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)) ); diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc index 5ce26f8..54d94c2 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc @@ -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)) ); diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc index cee6912..9afe428 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc @@ -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)) ); diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc index afb7336..53090b3 100644 --- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc +++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc @@ -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 } diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc index ba5f582..7b7e599 100644 --- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc +++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc @@ -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 } |