From de196e5dd8ea4d0ed01a8c265afdd3676e27545b Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 11 Jan 2022 18:42:38 +0000 Subject: [PATCH] libstdc++: Add attribute to features deprecated in C++17 [PR91260] There are a lot of things in the C++ standard library which were deprecated in C++11, and more in C++17. Some of them were removed after deprecation and are no longer present in the standard at all. We have not removed these from libstdc++ because keeping them as non-standard extensions is conforming, and avoids gratuitously breaking user code, and in some cases we need to keep using them to avoid ABI changes. But we should at least give a warning for using them. That has not been done previously because of the library's own uses of them (e.g. the std::iterator class template used as a base class). This adds deprecated attributes to the relevant components, and then goes through the whole library to add diagnostic pragmas where needed to suppress warnings about our internal uses of them. The tests are updated to either expect the additional warnings, or to suppress them where we aren't interested in them. libstdc++-v3/ChangeLog: PR libstdc++/91260 PR libstdc++/91383 PR libstdc++/95065 * include/backward/binders.h (bind1st, bind2nd): Add deprecated attribute. * include/bits/refwrap.h (_Maybe_unary_or_binary_function): Disable deprecated warnings for base classes. (_Reference_wrapper_base): Likewise. * include/bits/shared_ptr_base.h (_Sp_owner_less): Likewise. * include/bits/stl_bvector.h (_Bit_iterator_base): Likewise. * include/bits/stl_function.h (unary_function, binary_function): Add deprecated attribute. (unary_negate, not1, binary_negate, not2, ptr_fun) (pointer_to_unary_function, pointer_to_binary_function) (mem_fun_t, const_mem_fun_t, mem_fun_ref_t, const_mem_fun_ref_t) (mem_fun1_t, const_mem_fun1_t, mem_fun_ref1_t) (const_mem_fun1_ref_t, mem_fun, mem_fun_ref): Add deprecated attributes. * include/bits/stl_iterator.h: Disable deprecated warnings for std::iterator base classes. * include/bits/stl_iterator_base_types.h (iterator): Add deprecated attribute. * include/bits/stl_map.h (map::value_compare): Disable deprecated warnings for base class. * include/bits/stl_multimap.h (multimap::value_compare): Likewise. * include/bits/stl_raw_storage_iter.h (raw_storage_iterator): Add deprecated attribute. * include/bits/stl_tempbuf.h (get_temporary_buffer): Likewise. * include/bits/stream_iterator.h: Disable deprecated warnings. * include/bits/streambuf_iterator.h: Likewise. * include/ext/bitmap_allocator.h: Remove unary_function base classes. * include/ext/functional: Disable deprecated warnings. * include/ext/rope: Likewise. * include/ext/throw_allocator.h: Likewise. * include/std/type_traits (result_of): Add deprecated attribute. * include/tr1/functional: Disable deprecated warnings. * include/tr1/functional_hash.h: Likewise. * testsuite/20_util/function_objects/binders/1.cc: Add -Wno-disable-deprecations. * testsuite/20_util/function_objects/binders/3113.cc: Likewise. * testsuite/20_util/function_objects/constexpr.cc: Add dg-warning. * testsuite/20_util/raw_storage_iterator/base.cc: Likewise. * testsuite/20_util/raw_storage_iterator/dr2127.cc: Likewise. * testsuite/20_util/raw_storage_iterator/requirements/base_classes.cc: Likewise. * testsuite/20_util/raw_storage_iterator/requirements/explicit_instantiation/1.cc: Likewise. * testsuite/20_util/raw_storage_iterator/requirements/typedefs.cc: Likewise. * testsuite/20_util/reference_wrapper/24803.cc: Likewise. * testsuite/20_util/reference_wrapper/typedefs.cc: Enable for C++20 and check for absence of nested types. * testsuite/20_util/shared_ptr/comparison/less.cc: Remove std::binary_function base class. * testsuite/20_util/temporary_buffer.cc: Add dg-warning. * testsuite/21_strings/basic_string/cons/char/69092.cc: Remove std::iterator base class. * testsuite/24_iterators/back_insert_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/front_insert_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/insert_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/istream_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/istreambuf_iterator/92285.cc: Likewise. * testsuite/24_iterators/istreambuf_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/ostream_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/ostreambuf_iterator/requirements/base_classes.cc: Likewise. * testsuite/24_iterators/reverse_iterator/requirements/base_classes.cc: Likewise. * testsuite/25_algorithms/copy/34595.cc: Likewise. * testsuite/25_algorithms/minmax/3.cc: Remove std::binary_function base class. * testsuite/25_algorithms/all_of/requirements/explicit_instantiation/2.cc: Disable deprecated warnings. * testsuite/25_algorithms/all_of/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/any_of/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/any_of/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/count_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/count_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/find_end/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/find_end/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/find_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/find_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/for_each/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/for_each/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/none_of/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/none_of/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/partition/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/partition/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/search/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/search/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/search_n/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/search_n/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/25_algorithms/transform/requirements/explicit_instantiation/2.cc: Likewise. * testsuite/25_algorithms/transform/requirements/explicit_instantiation/pod.cc: Likewise. * testsuite/27_io/basic_filebuf/underflow/wchar_t/9178.cc: Add dg-warning. * testsuite/ext/pb_ds/example/priority_queue_erase_if.cc: Likewise. * testsuite/ext/pb_ds/example/priority_queue_split_join.cc: Likewise. * testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc: Disable deprecated warnings. * testsuite/tr1/6_containers/hash/requirements/base_classes.cc: Likewise. * testsuite/util/regression/trait/erase_if_fn.hpp: Remove std::unary_function base classes. * testsuite/util/testsuite_iterators.h (output_iterator_wrapper): Remove std::iterator base classes. --- libstdc++-v3/include/backward/binders.h | 2 + libstdc++-v3/include/bits/refwrap.h | 11 ++ libstdc++-v3/include/bits/shared_ptr_base.h | 3 + libstdc++-v3/include/bits/stl_bvector.h | 4 + libstdc++-v3/include/bits/stl_function.h | 63 +++++++--- libstdc++-v3/include/bits/stl_iterator.h | 6 + .../include/bits/stl_iterator_base_types.h | 2 +- libstdc++-v3/include/bits/stl_map.h | 3 + libstdc++-v3/include/bits/stl_multimap.h | 3 + libstdc++-v3/include/bits/stl_raw_storage_iter.h | 7 +- libstdc++-v3/include/bits/stl_tempbuf.h | 1 + libstdc++-v3/include/bits/stream_iterator.h | 5 + libstdc++-v3/include/bits/streambuf_iterator.h | 4 + libstdc++-v3/include/ext/bitmap_allocator.h | 11 +- libstdc++-v3/include/ext/functional | 5 + libstdc++-v3/include/ext/rope | 15 ++- libstdc++-v3/include/ext/throw_allocator.h | 5 + libstdc++-v3/include/std/type_traits | 2 +- libstdc++-v3/include/tr1/functional | 5 + libstdc++-v3/include/tr1/functional_hash.h | 5 + .../20_util/function_objects/binders/1.cc | 1 + .../20_util/function_objects/binders/3113.cc | 1 + .../20_util/function_objects/constexpr.cc | 14 ++- .../testsuite/20_util/raw_storage_iterator/base.cc | 4 +- .../20_util/raw_storage_iterator/dr2127.cc | 2 +- .../requirements/base_classes.cc | 4 +- .../requirements/explicit_instantiation/1.cc | 2 +- .../raw_storage_iterator/requirements/typedefs.cc | 2 +- .../testsuite/20_util/reference_wrapper/24803.cc | 4 +- .../20_util/reference_wrapper/typedefs.cc | 132 +++++++++++++++++++-- .../20_util/shared_ptr/comparison/less.cc | 2 +- libstdc++-v3/testsuite/20_util/temporary_buffer.cc | 2 +- .../21_strings/basic_string/cons/char/69092.cc | 9 +- .../requirements/base_classes.cc | 2 +- .../requirements/base_classes.cc | 2 +- .../insert_iterator/requirements/base_classes.cc | 2 +- .../istream_iterator/requirements/base_classes.cc | 2 +- .../24_iterators/istreambuf_iterator/92285.cc | 4 +- .../requirements/base_classes.cc | 5 +- .../ostream_iterator/requirements/base_classes.cc | 2 +- .../requirements/base_classes.cc | 2 +- .../reverse_iterator/requirements/base_classes.cc | 2 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- libstdc++-v3/testsuite/25_algorithms/copy/34595.cc | 2 +- .../requirements/explicit_instantiation/2.cc | 5 +- .../requirements/explicit_instantiation/pod.cc | 5 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 5 +- .../requirements/explicit_instantiation/pod.cc | 5 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 1 + .../requirements/explicit_instantiation/pod.cc | 1 + libstdc++-v3/testsuite/25_algorithms/minmax/3.cc | 5 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 5 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 1 + .../requirements/explicit_instantiation/pod.cc | 1 + .../requirements/explicit_instantiation/2.cc | 5 +- .../requirements/explicit_instantiation/pod.cc | 5 +- .../requirements/explicit_instantiation/2.cc | 5 +- .../requirements/explicit_instantiation/pod.cc | 5 +- .../requirements/explicit_instantiation/2.cc | 5 +- .../requirements/explicit_instantiation/pod.cc | 5 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 7 +- .../requirements/explicit_instantiation/pod.cc | 7 +- .../requirements/explicit_instantiation/2.cc | 7 +- .../requirements/explicit_instantiation/pod.cc | 7 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../requirements/explicit_instantiation/2.cc | 3 +- .../requirements/explicit_instantiation/pod.cc | 3 +- .../27_io/basic_filebuf/underflow/wchar_t/9178.cc | 2 +- .../ext/pb_ds/example/priority_queue_erase_if.cc | 2 +- .../ext/pb_ds/example/priority_queue_split_join.cc | 2 +- .../reference_wrapper/typedefs.cc | 2 + .../6_containers/hash/requirements/base_classes.cc | 1 + .../util/regression/trait/erase_if_fn.hpp | 8 +- libstdc++-v3/testsuite/util/testsuite_iterators.h | 15 ++- 99 files changed, 439 insertions(+), 138 deletions(-) diff --git a/libstdc++-v3/include/backward/binders.h b/libstdc++-v3/include/backward/binders.h index b88e260..5eac6c0 100644 --- a/libstdc++-v3/include/backward/binders.h +++ b/libstdc++-v3/include/backward/binders.h @@ -131,6 +131,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// One of the @link binders binder functors@endlink. template + _GLIBCXX11_DEPRECATED_SUGGEST("std::bind") inline binder1st<_Operation> bind1st(const _Operation& __fn, const _Tp& __x) { @@ -166,6 +167,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// One of the @link binders binder functors@endlink. template + _GLIBCXX11_DEPRECATED_SUGGEST("std::bind") inline binder2nd<_Operation> bind2nd(const _Operation& __fn, const _Tp& __x) { diff --git a/libstdc++-v3/include/bits/refwrap.h b/libstdc++-v3/include/bits/refwrap.h index cc8beeb..8016f87 100644 --- a/libstdc++-v3/include/bits/refwrap.h +++ b/libstdc++-v3/include/bits/refwrap.h @@ -52,6 +52,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct _Maybe_unary_or_binary_function { }; +// Ignore warnings about unary_function and binary_function. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /// Derives from @c unary_function, as appropriate. template struct _Maybe_unary_or_binary_function<_Res, _T1> @@ -62,6 +66,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct _Maybe_unary_or_binary_function<_Res, _T1, _T2> : std::binary_function<_T1, _T2, _Res> { }; +#pragma GCC diagnostic pop + template struct _Mem_fn_traits; @@ -215,6 +221,10 @@ _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type) : _Weak_result_type<_Tp>, _Refwrap_base_arg1<_Tp>, _Refwrap_base_arg2<_Tp> { }; +// Ignore warnings about unary_function and binary_function. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + // - a function type (unary) template struct _Reference_wrapper_base<_Res(_T1) _GLIBCXX_NOEXCEPT_QUAL> @@ -280,6 +290,7 @@ _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type) { using result_type = typename _Mem_fn_traits<_MemFunPtr>::__result_type; }; +#pragma GCC diagnostic pop #endif // ! C++20 /// @endcond diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index e16a925..9e80aab 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -2108,6 +2108,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION swap(__weak_ptr<_Tp, _Lp>& __a, __weak_ptr<_Tp, _Lp>& __b) noexcept { __a.swap(__b); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" template struct _Sp_owner_less : public binary_function<_Tp, _Tp, bool> { @@ -2123,6 +2125,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator()(const _Tp1& __lhs, const _Tp& __rhs) const noexcept { return __lhs.owner_before(__rhs); } }; +#pragma GCC diagnostic pop template<> struct _Sp_owner_less diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index f74501f..75f3881 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -156,6 +156,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #endif }; +// Ignore warnings about std::iterator. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" struct _Bit_iterator_base : public std::iterator { @@ -255,6 +258,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER + __x._M_offset - __y._M_offset); } }; +#pragma GCC diagnostic pop struct _Bit_iterator : public _Bit_iterator_base { diff --git a/libstdc++-v3/include/bits/stl_function.h b/libstdc++-v3/include/bits/stl_function.h index ab8a5a1..a1a770d 100644 --- a/libstdc++-v3/include/bits/stl_function.h +++ b/libstdc++-v3/include/bits/stl_function.h @@ -121,7 +121,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// @c result_type is the return type typedef _Result result_type; - }; + } _GLIBCXX11_DEPRECATED; /** * Helper for defining adaptable binary function objects. @@ -138,7 +138,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// @c result_type is the return type typedef _Result result_type; - }; + } _GLIBCXX11_DEPRECATED; /** @} */ // 20.3.2 arithmetic @@ -175,6 +175,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct negate; #endif +// Ignore warnings about unary_function and binary_function. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /// One of the @link arithmetic_functors math functors@endlink. template struct plus : public binary_function<_Tp, _Tp, _Tp> @@ -235,6 +239,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator()(const _Tp& __x) const { return -__x; } }; +#pragma GCC diagnostic pop #if __cplusplus > 201103L @@ -360,6 +365,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct less_equal; #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /// One of the @link comparison_functors comparison functors@endlink. template struct equal_to : public binary_function<_Tp, _Tp, bool> @@ -479,6 +487,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return (__UINTPTR_TYPE__)__x <= (__UINTPTR_TYPE__)__y; } }; +#pragma GCC diagnostic pop #if __cplusplus >= 201402L /// One of the @link comparison_functors comparison functors@endlink. @@ -779,6 +788,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct logical_not; #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /// One of the @link logical_functors Boolean operations functors@endlink. template struct logical_and : public binary_function<_Tp, _Tp, bool> @@ -808,6 +820,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator()(const _Tp& __x) const { return !__x; } }; +#pragma GCC diagnostic pop #if __cplusplus > 201103L /// One of the @link logical_functors Boolean operations functors@endlink. @@ -871,6 +884,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct bit_not; #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + // _GLIBCXX_RESOLVE_LIB_DEFECTS // DR 660. Missing Bitwise Operations. template @@ -908,6 +924,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator()(const _Tp& __x) const { return ~__x; } }; +#pragma GCC diagnostic pop #if __cplusplus > 201103L template <> @@ -965,7 +982,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef __is_transparent is_transparent; }; -#endif +#endif // C++14 + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // 20.3.5 negators /** @defgroup negators Negators @@ -1001,7 +1021,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ /// One of the @link negators negation functors@endlink. template - class unary_negate + class _GLIBCXX17_DEPRECATED unary_negate : public unary_function { protected: @@ -1020,6 +1040,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// One of the @link negators negation functors@endlink. template + _GLIBCXX17_DEPRECATED_SUGGEST("std::not_fn") _GLIBCXX14_CONSTEXPR inline unary_negate<_Predicate> not1(const _Predicate& __pred) @@ -1027,7 +1048,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// One of the @link negators negation functors@endlink. template - class binary_negate + class _GLIBCXX17_DEPRECATED binary_negate : public binary_function { @@ -1048,6 +1069,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// One of the @link negators negation functors@endlink. template + _GLIBCXX17_DEPRECATED_SUGGEST("std::not_fn") _GLIBCXX14_CONSTEXPR inline binary_negate<_Predicate> not2(const _Predicate& __pred) @@ -1095,10 +1117,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Result operator()(_Arg __x) const { return _M_ptr(__x); } - }; + } _GLIBCXX11_DEPRECATED; /// One of the @link pointer_adaptors adaptors for function pointers@endlink. template + _GLIBCXX11_DEPRECATED_SUGGEST("std::mem_fn") inline pointer_to_unary_function<_Arg, _Result> ptr_fun(_Result (*__x)(_Arg)) { return pointer_to_unary_function<_Arg, _Result>(__x); } @@ -1121,10 +1144,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Result operator()(_Arg1 __x, _Arg2 __y) const { return _M_ptr(__x, __y); } - }; + } _GLIBCXX11_DEPRECATED; /// One of the @link pointer_adaptors adaptors for function pointers@endlink. template + _GLIBCXX11_DEPRECATED_SUGGEST("std::mem_fn") inline pointer_to_binary_function<_Arg1, _Arg2, _Result> ptr_fun(_Result (*__x)(_Arg1, _Arg2)) { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); } @@ -1218,7 +1242,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: _Ret (_Tp::*_M_f)(); - }; + } _GLIBCXX11_DEPRECATED; /// One of the @link ptrmem_adaptors adaptors for member pointers@endlink. template @@ -1235,7 +1259,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: _Ret (_Tp::*_M_f)() const; - }; + } _GLIBCXX11_DEPRECATED; /// One of the @link ptrmem_adaptors adaptors for member pointers@endlink. template @@ -1252,7 +1276,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: _Ret (_Tp::*_M_f)(); - }; + } _GLIBCXX11_DEPRECATED; /// One of the @link ptrmem_adaptors adaptors for member pointers@endlink. template @@ -1269,7 +1293,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: _Ret (_Tp::*_M_f)() const; - }; + } _GLIBCXX11_DEPRECATED; /// One of the @link ptrmem_adaptors adaptors for member pointers@endlink. template @@ -1286,7 +1310,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: _Ret (_Tp::*_M_f)(_Arg); - }; + } _GLIBCXX11_DEPRECATED; /// One of the @link ptrmem_adaptors adaptors for member pointers@endlink. template @@ -1303,7 +1327,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: _Ret (_Tp::*_M_f)(_Arg) const; - }; + } _GLIBCXX11_DEPRECATED; /// One of the @link ptrmem_adaptors adaptors for member pointers@endlink. template @@ -1320,7 +1344,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: _Ret (_Tp::*_M_f)(_Arg); - }; + } _GLIBCXX11_DEPRECATED; /// One of the @link ptrmem_adaptors adaptors for member pointers@endlink. template @@ -1337,49 +1361,58 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: _Ret (_Tp::*_M_f)(_Arg) const; - }; + } _GLIBCXX11_DEPRECATED; // Mem_fun adaptor helper functions. There are only two: // mem_fun and mem_fun_ref. template + _GLIBCXX11_DEPRECATED_SUGGEST("std::mem_fn") inline mem_fun_t<_Ret, _Tp> mem_fun(_Ret (_Tp::*__f)()) { return mem_fun_t<_Ret, _Tp>(__f); } template + _GLIBCXX11_DEPRECATED_SUGGEST("std::mem_fn") inline const_mem_fun_t<_Ret, _Tp> mem_fun(_Ret (_Tp::*__f)() const) { return const_mem_fun_t<_Ret, _Tp>(__f); } template + _GLIBCXX11_DEPRECATED_SUGGEST("std::mem_fn") inline mem_fun_ref_t<_Ret, _Tp> mem_fun_ref(_Ret (_Tp::*__f)()) { return mem_fun_ref_t<_Ret, _Tp>(__f); } template + _GLIBCXX11_DEPRECATED_SUGGEST("std::mem_fn") inline const_mem_fun_ref_t<_Ret, _Tp> mem_fun_ref(_Ret (_Tp::*__f)() const) { return const_mem_fun_ref_t<_Ret, _Tp>(__f); } template + _GLIBCXX11_DEPRECATED_SUGGEST("std::mem_fn") inline mem_fun1_t<_Ret, _Tp, _Arg> mem_fun(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); } template + _GLIBCXX11_DEPRECATED_SUGGEST("std::mem_fn") inline const_mem_fun1_t<_Ret, _Tp, _Arg> mem_fun(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); } template + _GLIBCXX11_DEPRECATED_SUGGEST("std::mem_fn") inline mem_fun1_ref_t<_Ret, _Tp, _Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg)) { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } template + _GLIBCXX11_DEPRECATED_SUGGEST("std::mem_fn") inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg> mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const) { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); } +#pragma GCC diagnostic pop /** @} */ diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h index 24c106e..549a391 100644 --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -105,6 +105,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } #endif +// Ignore warnings about std::iterator. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + // 24.4.1 Reverse iterators /** * Bidirectional and random access iterators have corresponding reverse @@ -991,6 +995,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return *this; } }; +#pragma GCC diagnostic pop + /** * @param __x A container of arbitrary type. * @param __i An iterator into the container. diff --git a/libstdc++-v3/include/bits/stl_iterator_base_types.h b/libstdc++-v3/include/bits/stl_iterator_base_types.h index 964bbaf..9eecd1d 100644 --- a/libstdc++-v3/include/bits/stl_iterator_base_types.h +++ b/libstdc++-v3/include/bits/stl_iterator_base_types.h @@ -124,7 +124,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION */ template - struct iterator + struct _GLIBCXX17_DEPRECATED iterator { /// One of the @link iterator_tags tag types@endlink. typedef _Category iterator_category; diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index 5b477f5..625760d 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -126,6 +126,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #endif public: +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" class value_compare : public std::binary_function { @@ -140,6 +142,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER bool operator()(const value_type& __x, const value_type& __y) const { return comp(__x.first, __y.first); } }; +#pragma GCC diagnostic pop private: /// This turns a red-black tree into a [multi]map. diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index 4375f5e..f6b08bc 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -125,6 +125,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #endif public: +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" class value_compare : public std::binary_function { @@ -139,6 +141,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER bool operator()(const value_type& __x, const value_type& __y) const { return comp(__x.first, __y.first); } }; +#pragma GCC diagnostic pop private: /// This turns a red-black tree into a [multi]map. diff --git a/libstdc++-v3/include/bits/stl_raw_storage_iter.h b/libstdc++-v3/include/bits/stl_raw_storage_iter.h index d4e2552..063c01c 100644 --- a/libstdc++-v3/include/bits/stl_raw_storage_iter.h +++ b/libstdc++-v3/include/bits/stl_raw_storage_iter.h @@ -60,12 +60,16 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION +// Ignore warnings about std::iterator. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /** * This iterator class lets algorithms store their results into * uninitialized memory. */ template - class raw_storage_iterator + class _GLIBCXX17_DEPRECATED raw_storage_iterator : public iterator { protected: @@ -116,6 +120,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // 2454. Add raw_storage_iterator::base() member _OutputIterator base() const { return _M_iter; } }; +#pragma GCC diagnostic pop _GLIBCXX_END_NAMESPACE_VERSION } // namespace diff --git a/libstdc++-v3/include/bits/stl_tempbuf.h b/libstdc++-v3/include/bits/stl_tempbuf.h index b52390f..654c6a8 100644 --- a/libstdc++-v3/include/bits/stl_tempbuf.h +++ b/libstdc++-v3/include/bits/stl_tempbuf.h @@ -96,6 +96,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * Provides the nothrow exception guarantee. */ template + _GLIBCXX14_DEPRECATED pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __len) _GLIBCXX_NOEXCEPT { diff --git a/libstdc++-v3/include/bits/stream_iterator.h b/libstdc++-v3/include/bits/stream_iterator.h index e21875a..86c5845 100644 --- a/libstdc++-v3/include/bits/stream_iterator.h +++ b/libstdc++-v3/include/bits/stream_iterator.h @@ -43,6 +43,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @{ */ +// Ignore warnings about std::iterator. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /// Provides input iterator semantics for streams. template, typename _Dist = ptrdiff_t> @@ -256,6 +260,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator++(int) _GLIBCXX_NOEXCEPT { return *this; } }; +#pragma GCC diagnostic pop /// @} group iterators diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h index e1a2d17..72344c6 100644 --- a/libstdc++-v3/include/bits/streambuf_iterator.h +++ b/libstdc++-v3/include/bits/streambuf_iterator.h @@ -44,6 +44,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @{ */ +// Ignore warnings about std::iterator. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // 24.5.3 Template class istreambuf_iterator /// Provides input iterator semantics for streambufs. template @@ -326,6 +329,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return *this; } }; +#pragma GCC diagnostic pop // Overloads for streambuf iterators. template diff --git a/libstdc++-v3/include/ext/bitmap_allocator.h b/libstdc++-v3/include/ext/bitmap_allocator.h index 3edfce9..033f132 100644 --- a/libstdc++-v3/include/ext/bitmap_allocator.h +++ b/libstdc++-v3/include/ext/bitmap_allocator.h @@ -277,7 +277,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // _Tp should be a pointer type. template class _Inclusive_between - : public std::unary_function, bool> { typedef _Tp pointer; pointer _M_ptr_value; @@ -301,8 +300,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Used to pass a Functor to functions by reference. template class _Functor_Ref - : public std::unary_function { _Functor& _M_fref; @@ -327,16 +324,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // the vector. template class _Ffit_finder - : public std::unary_function, bool> { - typedef typename std::pair<_Tp, _Tp> _Block_pair; - typedef typename __detail::__mini_vector<_Block_pair> _BPVector; + typedef std::pair<_Tp, _Tp> _Block_pair; + typedef __detail::__mini_vector<_Block_pair> _BPVector; typedef typename _BPVector::difference_type _Counter_type; std::size_t* _M_pbitmap; _Counter_type _M_data_offset; public: + typedef bool result_type; + typedef _Block_pair argument_type; + _Ffit_finder() : _M_pbitmap(0), _M_data_offset(0) { } diff --git a/libstdc++-v3/include/ext/functional b/libstdc++-v3/include/ext/functional index cebf86d..19cd8d5 100644 --- a/libstdc++-v3/include/ext/functional +++ b/libstdc++-v3/include/ext/functional @@ -64,6 +64,9 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /** The @c identity_element functions are not part of the C++ * standard; SGI provided them as an extension. Its argument is an * operation, and its return value is the identity element for that @@ -391,6 +394,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { _M_initialize(161803398u); } }; +#pragma GCC diagnostic pop + // Mem_fun adaptor helper functions mem_fun1 and mem_fun1_ref, // provided for backward compatibility, they are no longer part of // the C++ standard. diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope index 303f1d9..f8af374 100644 --- a/libstdc++-v3/include/ext/rope +++ b/libstdc++-v3/include/ext/rope @@ -171,6 +171,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // behave a little like basic_ostringstream and a // little like containers. +// Ignore warnings about std::iterator. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + template class sequence_buffer : public std::iterator @@ -306,6 +310,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator++(int) { return *this; } }; +#pragma GCC diagnostic pop // The following should be treated as private, at least for now. template @@ -430,7 +435,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Some helpers, so we can use power on ropes. // See below for why this isn't local to the implementation. - + +// Ignore warnings about std::binary_function. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // This uses a nonstandard refcount convention. // The result has refcount 0. template @@ -443,6 +451,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const rope<_CharT, _Alloc>& __y) { return __x + __y; } }; +#pragma GCC diagnostic pop template inline rope<_CharT, _Alloc> @@ -1059,6 +1068,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Iterators are assumed to be thread private. Ropes can // be shared. +// Ignore warnings about std::iterator +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" template class _Rope_iterator_base : public std::iterator @@ -1136,6 +1148,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } }; +#pragma GCC diagnostic pop template class _Rope_iterator; diff --git a/libstdc++-v3/include/ext/throw_allocator.h b/libstdc++-v3/include/ext/throw_allocator.h index 870242c..220f5f5 100644 --- a/libstdc++-v3/include/ext/throw_allocator.h +++ b/libstdc++-v3/include/ext/throw_allocator.h @@ -982,6 +982,9 @@ _GLIBCXX_END_NAMESPACE_VERSION namespace std _GLIBCXX_VISIBILITY(default) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /// Explicit specialization of std::hash for __gnu_cxx::throw_value_limit. template<> struct hash<__gnu_cxx::throw_value_limit> @@ -1013,6 +1016,8 @@ namespace std _GLIBCXX_VISIBILITY(default) } }; #endif + +#pragma GCC diagnostic pop } // end namespace std #endif diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 7d92d7e..75f50e3 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2594,7 +2594,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct result_of<_Functor(_ArgTypes...)> : public __invoke_result<_Functor, _ArgTypes...> - { }; + { } _GLIBCXX17_DEPRECATED_SUGGEST("std::invoke_result"); #if __cplusplus >= 201402L /// Alias template for aligned_storage diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional index c4cfc45..83d22be 100644 --- a/libstdc++-v3/include/tr1/functional +++ b/libstdc++-v3/include/tr1/functional @@ -264,6 +264,10 @@ namespace tr1 typedef void type; }; +// Ignore warnings about std::unary_function and std::binary_function. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /// Determines if the type _Tp derives from unary_function. template struct _Derives_from_unary_function : __sfinae_types @@ -2089,6 +2093,7 @@ namespace tr1 typedef _Res (*_Invoker_type)(const _Any_data&, _ArgTypes...); _Invoker_type _M_invoker; }; +#pragma GCC diagnostic pop template function<_Res(_ArgTypes...)>:: diff --git a/libstdc++-v3/include/tr1/functional_hash.h b/libstdc++-v3/include/tr1/functional_hash.h index 6a0f75b..0146cd7 100644 --- a/libstdc++-v3/include/tr1/functional_hash.h +++ b/libstdc++-v3/include/tr1/functional_hash.h @@ -38,6 +38,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace tr1 { +// Ignore warnings about std::unary_function and std::binary_function. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + /// Class template hash. // Declaration of default hash functor std::tr1::hash. The types for // which std::tr1::hash is well-defined is in clause 6.3.3. of the PDTR. @@ -56,6 +60,7 @@ namespace tr1 operator()(_Tp* __p) const { return reinterpret_cast(__p); } }; +#pragma GCC diagnostic pop /// Explicit specializations for integer types. #define _TR1_hashtable_define_trivial_hash(_Tp) \ diff --git a/libstdc++-v3/testsuite/20_util/function_objects/binders/1.cc b/libstdc++-v3/testsuite/20_util/function_objects/binders/1.cc index 3d19618..35d6050 100644 --- a/libstdc++-v3/testsuite/20_util/function_objects/binders/1.cc +++ b/libstdc++-v3/testsuite/20_util/function_objects/binders/1.cc @@ -17,6 +17,7 @@ // 20.3.6 Binders +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } #include diff --git a/libstdc++-v3/testsuite/20_util/function_objects/binders/3113.cc b/libstdc++-v3/testsuite/20_util/function_objects/binders/3113.cc index 8944d15..23c7d0d 100644 --- a/libstdc++-v3/testsuite/20_util/function_objects/binders/3113.cc +++ b/libstdc++-v3/testsuite/20_util/function_objects/binders/3113.cc @@ -17,6 +17,7 @@ // with this library; see the file COPYING3. If not see // . +// { dg-options "-Wno-deprecated-declarations" } // { dg-add-options using-deprecated } // 20.3.6 Binders diff --git a/libstdc++-v3/testsuite/20_util/function_objects/constexpr.cc b/libstdc++-v3/testsuite/20_util/function_objects/constexpr.cc index 7072ede..8ff6dd1 100644 --- a/libstdc++-v3/testsuite/20_util/function_objects/constexpr.cc +++ b/libstdc++-v3/testsuite/20_util/function_objects/constexpr.cc @@ -67,10 +67,12 @@ static_assert(std::bit_or()(1,2)==3, ""); static_assert(std::bit_xor()(1,1)==0, ""); static_assert(std::bit_not()(std::bit_not()(0))==0, ""); -static_assert(std::unary_negate> - (std::logical_not())(1), ""); -static_assert(std::not1(std::logical_not())(1), ""); +static_assert(std::unary_negate< // { dg-warning "is deprecated" "" { target c++17 } } + std::logical_not + >(std::logical_not())(1), ""); +static_assert(std::not1(std::logical_not())(1), ""); // { dg-warning "is deprecated" "" { target c++17 } } -static_assert(std::binary_negate> - (std::logical_and())(0,0), ""); -static_assert(std::not2(std::logical_and())(0,0), ""); +static_assert(std::binary_negate< // { dg-warning "is deprecated" "" { target c++17 } } + std::logical_and + >(std::logical_and())(0,0), ""); +static_assert(std::not2(std::logical_and())(0,0), ""); // { dg-warning "is deprecated" "" { target c++17 } } diff --git a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/base.cc b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/base.cc index 7467653..95a9012 100644 --- a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/base.cc +++ b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/base.cc @@ -15,7 +15,7 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do run { target c++11 } } +// { dg-do run } #include #include @@ -24,7 +24,7 @@ void test01() { int a[2]; - auto it = std::raw_storage_iterator(a); + std::raw_storage_iterator it(a); // { dg-warning "is deprecated" "" { target c++17 } } VERIFY( it.base() == a ); VERIFY( (++it).base() == a+1 ); } diff --git a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/dr2127.cc b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/dr2127.cc index d1e5bf0..b31d3fe 100644 --- a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/dr2127.cc +++ b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/dr2127.cc @@ -32,7 +32,7 @@ test01() { char buf[sizeof(MoveOnly)*2]; MoveOnly* addr = (MoveOnly*)buf; - std::raw_storage_iterator iter(addr); + std::raw_storage_iterator iter(addr); // { dg-warning "is deprecated" "" { target c++17 } } *iter++ = MoveOnly{1}; *iter++ = MoveOnly{2}; VERIFY( addr[0].i == 1 ); diff --git a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/base_classes.cc index 25f7f52..52947f2 100644 --- a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/base_classes.cc +++ b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/base_classes.cc @@ -29,8 +29,8 @@ void test01() // Check for required base class. long l; - typedef raw_storage_iterator test_iterator; - typedef iterator base_iterator; + typedef raw_storage_iterator test_iterator; // { dg-warning "is deprecated" "" { target c++17 } } + typedef iterator base_iterator; // { dg-warning "is deprecated" "" { target c++17 } } test_iterator rs_it(&l); base_iterator* base __attribute__((unused)) = &rs_it; } diff --git a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/explicit_instantiation/1.cc index 9e5c04d..9cd713f 100644 --- a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/explicit_instantiation/1.cc +++ b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/explicit_instantiation/1.cc @@ -22,4 +22,4 @@ #include -template class std::raw_storage_iterator; +template class std::raw_storage_iterator; // { dg-warning "is deprecated" "" { target c++17 } } diff --git a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/typedefs.cc index 7ede288..ede9f13 100644 --- a/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/typedefs.cc @@ -27,7 +27,7 @@ void test01() using namespace std; // Check for required typedefs - typedef raw_storage_iterator test_iterator; + typedef raw_storage_iterator test_iterator; // { dg-warning "is deprecated" "" { target c++17 } } typedef test_iterator::value_type value_type; typedef test_iterator::difference_type difference_type; typedef test_iterator::pointer pointer; diff --git a/libstdc++-v3/testsuite/20_util/reference_wrapper/24803.cc b/libstdc++-v3/testsuite/20_util/reference_wrapper/24803.cc index 98a8d7e..91441f8 100644 --- a/libstdc++-v3/testsuite/20_util/reference_wrapper/24803.cc +++ b/libstdc++-v3/testsuite/20_util/reference_wrapper/24803.cc @@ -28,12 +28,12 @@ struct test_type int cmember2(char)const; }; -struct functor1 : public std::unary_function +struct functor1 : public std::unary_function // { dg-warning "is deprecated" } { double operator()(int) const; }; -struct functor2 : public std::binary_function +struct functor2 : public std::binary_function // { dg-warning "is deprecated" } { double operator()(int, char) const; }; diff --git a/libstdc++-v3/testsuite/20_util/reference_wrapper/typedefs.cc b/libstdc++-v3/testsuite/20_util/reference_wrapper/typedefs.cc index 0120817..a8f3fb2 100644 --- a/libstdc++-v3/testsuite/20_util/reference_wrapper/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/reference_wrapper/typedefs.cc @@ -1,5 +1,5 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } -// { dg-skip-if "result_type removed for C++20" { c++2a } } // Copyright (C) 2008-2022 Free Software Foundation, Inc. // @@ -21,6 +21,72 @@ #include #include +namespace __gnu_test +{ + +template using void_t = void; + +struct none; + +#if __cplusplus <= 201703L +// For C++11/14/17 if the nested type is not found, require +// that the test used 'none' as the expected type. +template using not_found = std::is_same; +// A nested type needs to match the expected type. +template using found = std::is_same; +#else +// For C++20 the nested type should always be not found. +template using not_found = std::true_type; +// Any nested type is bad. +template using found = std::false_type; +#endif + +template +struct check_result_type +: not_found +{ }; + +// Matches when reference_wrapper::result_type exists +template +struct check_result_type::result_type>> +: found::result_type> +{ }; + +template +struct check_arg_type +: not_found +{ }; + +// Matches when reference_wrapper::argument_type exists +template +struct check_arg_type::argument_type>> +: found::argument_type> +{ }; + +template +struct check_first_arg_type +: not_found +{ }; + +// Matches when reference_wrapper::first_argument_type exists +template +struct check_first_arg_type::first_argument_type>> +: found::first_argument_type> +{ }; + +template +struct check_second_arg_type +: not_found +{ }; + +// Matches when reference_wrapper::second_argument_type exists +template +struct check_second_arg_type::second_argument_type>> +: found::second_argument_type> +{ }; + +} // namespace __gnu_test + struct X {}; struct int_result_type { typedef int result_type; }; @@ -38,22 +104,66 @@ struct derives_unary_binary void test01() { - using std::reference_wrapper; using std::is_same; + using __gnu_test::check_result_type; + using __gnu_test::none; // Check result_type typedef - static_assert( is_same::result_type, int>::value, "has result_type" ); - static_assert( is_same::result_type, int>::value, "has result_type" ); - static_assert( is_same::result_type, int>::value, "has result_type" ); - static_assert( is_same::result_type, int>::value, "has result_type" ); - static_assert( is_same::result_type, int>::value, "has result_type" ); - static_assert( is_same::result_type, int>::value, "has result_type" ); - static_assert( is_same::result_type, int>::value, "has result_type" ); - static_assert( is_same::result_type, int>::value, "has result_type" ); + static_assert( check_result_type::value, "has result_type" ); + static_assert( check_result_type::value, "has result_type" ); + static_assert( check_result_type::value, "has result_type" ); + static_assert( check_result_type::value, "has result_type" ); + static_assert( check_result_type::value, "has result_type" ); + static_assert( check_result_type::value, "has result_type" ); + static_assert( check_result_type::value, "has result_type" ); + static_assert( check_result_type::value, "has result_type" ); +} + +void test02() +{ + using __gnu_test::check_arg_type; + using __gnu_test::check_first_arg_type; + using __gnu_test::check_second_arg_type; + using __gnu_test::none; + + // Check argument_type typedef + static_assert( check_arg_type::value, "" ); + static_assert( check_arg_type::value, "" ); + static_assert( check_arg_type::value, "" ); + static_assert( check_arg_type::value, "" ); + static_assert( check_arg_type::value, "" ); + static_assert( check_arg_type::value, "" ); + static_assert( check_arg_type::value, "" ); + static_assert( check_arg_type::value, "" ); + static_assert( check_arg_type::value, "" ); + static_assert( check_arg_type::value, "" ); + + // Check first_argument_type typedef + static_assert( check_first_arg_type::value, "" ); + static_assert( check_first_arg_type::value, "" ); + static_assert( check_first_arg_type::value, "" ); + static_assert( check_first_arg_type::value, "" ); + static_assert( check_first_arg_type::value, "" ); + static_assert( check_first_arg_type::value, "" ); + static_assert( check_first_arg_type::value, "" ); + static_assert( check_first_arg_type::value, "" ); + static_assert( check_first_arg_type::value, "" ); + static_assert( check_first_arg_type::value, "" ); + + // Check second_argument_type typedef + static_assert( check_second_arg_type::value, "" ); + static_assert( check_second_arg_type::value, "" ); + static_assert( check_second_arg_type::value, "" ); + static_assert( check_second_arg_type::value, "" ); + static_assert( check_second_arg_type::value, "" ); + static_assert( check_second_arg_type::value, "" ); + static_assert( check_second_arg_type::value, "" ); + static_assert( check_second_arg_type::value, "" ); + static_assert( check_second_arg_type::value, "" ); + static_assert( check_second_arg_type::value, "" ); } int main() { test01(); - return 0; } diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc index 049b19c..5061e99 100644 --- a/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc @@ -27,7 +27,7 @@ struct A { }; namespace std { template<> - struct less : binary_function + struct less { static int count; bool operator()(A* l, A* r) { ++count; return l < r; } diff --git a/libstdc++-v3/testsuite/20_util/temporary_buffer.cc b/libstdc++-v3/testsuite/20_util/temporary_buffer.cc index 3625074..3f36259 100644 --- a/libstdc++-v3/testsuite/20_util/temporary_buffer.cc +++ b/libstdc++-v3/testsuite/20_util/temporary_buffer.cc @@ -27,7 +27,7 @@ struct junk { char j[12]; }; int main(void) { typedef std::pair pair_type; - pair_type results = std::get_temporary_buffer(5); + pair_type results = std::get_temporary_buffer(5); // { dg-warning "deprecated" "" { target c++14 } } if (results.second != 0) { diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/69092.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/69092.cc index 2faf380..5279e439 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/69092.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/69092.cc @@ -22,7 +22,14 @@ #include #include -struct hate_T_iterator : std::iterator { +struct hate_T_iterator { + + typedef std::forward_iterator_tag iterator_category; + typedef char value_type; + typedef std::ptrdiff_t difference_type; + typedef char* pointer; + typedef char& reference; + explicit hate_T_iterator(char* p) : p(p) {} char* p; diff --git a/libstdc++-v3/testsuite/24_iterators/back_insert_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/24_iterators/back_insert_iterator/requirements/base_classes.cc index 1b7ad89..3a3208a 100644 --- a/libstdc++-v3/testsuite/24_iterators/back_insert_iterator/requirements/base_classes.cc +++ b/libstdc++-v3/testsuite/24_iterators/back_insert_iterator/requirements/base_classes.cc @@ -30,7 +30,7 @@ void test01() // Check for required base class. list l; typedef back_insert_iterator > test_iterator; - typedef iterator base_iterator; + typedef iterator base_iterator; // { dg-warning "is deprecated" "" { target c++17 } } test_iterator r_it(l); base_iterator* base __attribute__((unused)) = &r_it; } diff --git a/libstdc++-v3/testsuite/24_iterators/front_insert_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/24_iterators/front_insert_iterator/requirements/base_classes.cc index d310e05..7fd4932 100644 --- a/libstdc++-v3/testsuite/24_iterators/front_insert_iterator/requirements/base_classes.cc +++ b/libstdc++-v3/testsuite/24_iterators/front_insert_iterator/requirements/base_classes.cc @@ -30,7 +30,7 @@ void test01() // Check for required base class. list l; typedef front_insert_iterator > test_iterator; - typedef iterator base_iterator; + typedef iterator base_iterator; // { dg-warning "is deprecated" "" { target c++17 } } test_iterator r_it(l); base_iterator* base __attribute__((unused)) = &r_it; } diff --git a/libstdc++-v3/testsuite/24_iterators/insert_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/24_iterators/insert_iterator/requirements/base_classes.cc index 85bd82d..eafb6b2 100644 --- a/libstdc++-v3/testsuite/24_iterators/insert_iterator/requirements/base_classes.cc +++ b/libstdc++-v3/testsuite/24_iterators/insert_iterator/requirements/base_classes.cc @@ -32,7 +32,7 @@ void test01() list::iterator li = l.begin(); typedef insert_iterator > test_iterator; - typedef iterator base_iterator; + typedef iterator base_iterator; // { dg-warning "is deprecated" "" { target c++17 } } test_iterator r_it(l, li); base_iterator* base __attribute__((unused)) = &r_it; } diff --git a/libstdc++-v3/testsuite/24_iterators/istream_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/24_iterators/istream_iterator/requirements/base_classes.cc index 8bcc671..a3d3952 100644 --- a/libstdc++-v3/testsuite/24_iterators/istream_iterator/requirements/base_classes.cc +++ b/libstdc++-v3/testsuite/24_iterators/istream_iterator/requirements/base_classes.cc @@ -30,7 +30,7 @@ void test01() // Check for required base class. typedef istream_iterator test_iterator; - typedef iterator base_iterator; test_iterator r_it; base_iterator* base __attribute__((unused)) = &r_it; diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/92285.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/92285.cc index 5a3dc12..07f46a9 100644 --- a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/92285.cc +++ b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/92285.cc @@ -24,8 +24,8 @@ typedef std::input_iterator_tag category; typedef std::char_traits::off_type off_type; -typedef std::iterator good; -typedef std::iterator bad; +typedef std::iterator good; // { dg-warning "is deprecated" "" { target c++17 } } +typedef std::iterator bad; // { dg-warning "is deprecated" "" { target c++17 } } bool check(good&) { return true; } void check(bad&) { } diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/requirements/base_classes.cc index c8a2deb..3540362 100644 --- a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/requirements/base_classes.cc +++ b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/requirements/base_classes.cc @@ -32,8 +32,9 @@ void test01() typedef istreambuf_iterator test_iterator; typedef char_traits::off_type off_type; - // This is the base class required since LWG 445, which differs from C++03: - typedef iterator + // This is the base class required since LWG 445, which differs from C++03. + // We derive from this unconditionally, then override 'reference' for C++03. + typedef iterator // { dg-warning "is deprecated" "" { target c++17 } } base_iterator; istringstream isstream("this tag"); diff --git a/libstdc++-v3/testsuite/24_iterators/ostream_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/24_iterators/ostream_iterator/requirements/base_classes.cc index 23d8988..a979ac9 100644 --- a/libstdc++-v3/testsuite/24_iterators/ostream_iterator/requirements/base_classes.cc +++ b/libstdc++-v3/testsuite/24_iterators/ostream_iterator/requirements/base_classes.cc @@ -30,7 +30,7 @@ void test01() // Check for required base class. typedef ostream_iterator test_iterator; - typedef iterator base_iterator; + typedef iterator base_iterator; // { dg-warning "is deprecated" "" { target c++17 } } ostringstream osstream("this tag"); test_iterator r_it(osstream); base_iterator* base __attribute__((unused)) = &r_it; diff --git a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/requirements/base_classes.cc index def29e0..c7cfd80 100644 --- a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/requirements/base_classes.cc +++ b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/requirements/base_classes.cc @@ -30,7 +30,7 @@ void test01() // Check for required base class. typedef ostreambuf_iterator test_iterator; - typedef iterator base_iterator; + typedef iterator base_iterator; // { dg-warning "is deprecated" "" { target c++17 } } ostringstream osstream("this tag"); test_iterator r_it(osstream); base_iterator* base __attribute__((unused)) = &r_it; diff --git a/libstdc++-v3/testsuite/24_iterators/reverse_iterator/requirements/base_classes.cc b/libstdc++-v3/testsuite/24_iterators/reverse_iterator/requirements/base_classes.cc index 4b3322e..4de138c 100644 --- a/libstdc++-v3/testsuite/24_iterators/reverse_iterator/requirements/base_classes.cc +++ b/libstdc++-v3/testsuite/24_iterators/reverse_iterator/requirements/base_classes.cc @@ -29,7 +29,7 @@ void test01() // Check for required base class. long l; typedef reverse_iterator test_iterator; - typedef iterator::iterator_category, + typedef iterator::iterator_category, // { dg-warning "is deprecated" "" { target c++17 } } iterator_traits::value_type, iterator_traits::difference_type, iterator_traits::pointer, diff --git a/libstdc++-v3/testsuite/25_algorithms/all_of/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/all_of/requirements/explicit_instantiation/2.cc index 4724eb9..d2ff028 100644 --- a/libstdc++-v3/testsuite/25_algorithms/all_of/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/all_of/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-25 Paolo Carlini @@ -33,4 +34,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template bool all_of(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/all_of/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/all_of/requirements/explicit_instantiation/pod.cc index ecd6abe..5cc29a6 100644 --- a/libstdc++-v3/testsuite/25_algorithms/all_of/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/all_of/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-25 Paolo Carlini @@ -32,4 +33,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template bool all_of(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/any_of/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/any_of/requirements/explicit_instantiation/2.cc index ad306f7..910b117 100644 --- a/libstdc++-v3/testsuite/25_algorithms/any_of/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/any_of/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-25 Paolo Carlini @@ -33,4 +34,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template bool any_of(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/any_of/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/any_of/requirements/explicit_instantiation/pod.cc index 17d1399..d170961 100644 --- a/libstdc++-v3/testsuite/25_algorithms/any_of/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/any_of/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-25 Paolo Carlini @@ -32,4 +33,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template bool any_of(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/34595.cc b/libstdc++-v3/testsuite/25_algorithms/copy/34595.cc index b1525ee..d9bd3b6 100644 --- a/libstdc++-v3/testsuite/25_algorithms/copy/34595.cc +++ b/libstdc++-v3/testsuite/25_algorithms/copy/34595.cc @@ -21,7 +21,7 @@ #include class Counting_output_iterator -: public std::iterator< std::output_iterator_tag, void, void, void, void > +: public std::iterator< std::output_iterator_tag, void, void, void, void > // { dg-warning "is deprecated" "" { target c++17 } } { std::size_t c; public: diff --git a/libstdc++-v3/testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/2.cc index 4cd47a6..975c946 100644 --- a/libstdc++-v3/testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-24 Paolo Carlini @@ -32,6 +33,6 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_unary_function predicate_type; - template iterator_type copy_if(iterator_type, iterator_type, + template iterator_type copy_if(iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/pod.cc index 04a9a6f..3f58dc5 100644 --- a/libstdc++-v3/testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-24 Paolo Carlini @@ -31,6 +32,6 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_unary_function predicate_type; - template iterator_type copy_if(iterator_type, iterator_type, + template iterator_type copy_if(iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/count_if/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/count_if/requirements/explicit_instantiation/2.cc index 8d531bc..7431baf 100644 --- a/libstdc++-v3/testsuite/25_algorithms/count_if/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/count_if/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -34,4 +35,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template difference_type count_if(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/count_if/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/count_if/requirements/explicit_instantiation/pod.cc index 7fba3c6..2699d29 100644 --- a/libstdc++-v3/testsuite/25_algorithms/count_if/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/count_if/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -33,4 +34,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template difference_type count_if(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/find_end/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/find_end/requirements/explicit_instantiation/2.cc index 693a991..d2a0479 100644 --- a/libstdc++-v3/testsuite/25_algorithms/find_end/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/find_end/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -38,4 +39,4 @@ namespace std template iterator_type find_end(iterator_type, iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/find_end/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/find_end/requirements/explicit_instantiation/pod.cc index ac46beb..684152a 100644 --- a/libstdc++-v3/testsuite/25_algorithms/find_end/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/find_end/requirements/explicit_instantiation/pod.cc @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-deprecated-declarations" { target c++11 } } // 2007-09-20 Benjamin Kosnik @@ -37,4 +38,4 @@ namespace std template iterator_type find_end(iterator_type, iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/2.cc index 96a4f6e..6dd6f9f 100644 --- a/libstdc++-v3/testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/2.cc @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-deprecated-declarations" { target c++11 } } // 2007-09-20 Benjamin Kosnik @@ -38,4 +39,4 @@ namespace std template iterator_type find_first_of(iterator_type, iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/pod.cc index 4749298..8ec2b21 100644 --- a/libstdc++-v3/testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/pod.cc @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-additional-options "-Wno-deprecated-declarations" { target c++11 } } // 2007-09-20 Benjamin Kosnik @@ -37,4 +38,4 @@ namespace std template iterator_type find_first_of(iterator_type, iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/find_if/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/find_if/requirements/explicit_instantiation/2.cc index 66c512e..f3cd559 100644 --- a/libstdc++-v3/testsuite/25_algorithms/find_if/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/find_if/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -33,4 +34,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template iterator_type find_if(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/find_if/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/find_if/requirements/explicit_instantiation/pod.cc index d603e42..2326cb8 100644 --- a/libstdc++-v3/testsuite/25_algorithms/find_if/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/find_if/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -32,4 +33,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template iterator_type find_if(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/2.cc index 3326784..9f87232 100644 --- a/libstdc++-v3/testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-25 Paolo Carlini @@ -33,4 +34,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template iterator_type find_if_not(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/pod.cc index 63f2886..042eace 100644 --- a/libstdc++-v3/testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-25 Paolo Carlini @@ -32,4 +33,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template iterator_type find_if_not(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/for_each/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/for_each/requirements/explicit_instantiation/2.cc index 51b1d93..f7e09f8 100644 --- a/libstdc++-v3/testsuite/25_algorithms/for_each/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/for_each/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -32,6 +33,6 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_unary_function function_type; - template function_type for_each(iterator_type, iterator_type, + template function_type for_each(iterator_type, iterator_type, function_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/for_each/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/for_each/requirements/explicit_instantiation/pod.cc index ce28d6c..eb2ddaf 100644 --- a/libstdc++-v3/testsuite/25_algorithms/for_each/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/for_each/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -31,6 +32,6 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_unary_function function_type; - template function_type for_each(iterator_type, iterator_type, + template function_type for_each(iterator_type, iterator_type, function_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/2.cc index 80e22fe..7be1f40 100644 --- a/libstdc++-v3/testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-27 Paolo Carlini @@ -33,4 +34,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template bool is_partitioned(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/pod.cc index 678c202..2cc9e80 100644 --- a/libstdc++-v3/testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-27 Paolo Carlini @@ -32,4 +33,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template bool is_partitioned(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/2.cc index 1a67e11..8940b4d 100644 --- a/libstdc++-v3/testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2011-01-13 Paolo Carlini diff --git a/libstdc++-v3/testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/pod.cc index 60c5043..d7b38c9 100644 --- a/libstdc++-v3/testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2011-01-13 Paolo Carlini diff --git a/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc b/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc index 2e849cf..73e0c33 100644 --- a/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc +++ b/libstdc++-v3/testsuite/25_algorithms/minmax/3.cc @@ -24,8 +24,11 @@ #include struct compare_counter - : std::binary_function { + typedef int result_type; + typedef int first_argument_type; + typedef bool second_argument_type; + static int count; bool operator()(int a, int b) const diff --git a/libstdc++-v3/testsuite/25_algorithms/none_of/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/none_of/requirements/explicit_instantiation/2.cc index f5aaf30..e4460da 100644 --- a/libstdc++-v3/testsuite/25_algorithms/none_of/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/none_of/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-25 Paolo Carlini @@ -33,4 +34,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template bool none_of(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/none_of/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/none_of/requirements/explicit_instantiation/pod.cc index 40b165f..52e6dbb 100644 --- a/libstdc++-v3/testsuite/25_algorithms/none_of/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/none_of/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-25 Paolo Carlini @@ -32,4 +33,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template bool none_of(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/partition/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/partition/requirements/explicit_instantiation/2.cc index 4244590..a2b97ba 100644 --- a/libstdc++-v3/testsuite/25_algorithms/partition/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/partition/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -34,4 +35,4 @@ namespace std template iterator_type partition(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/partition/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/partition/requirements/explicit_instantiation/pod.cc index 5b143f3..4d9a8e4 100644 --- a/libstdc++-v3/testsuite/25_algorithms/partition/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/partition/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -33,4 +34,4 @@ namespace std template iterator_type partition(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/2.cc index 994a3c5..e8924b4 100644 --- a/libstdc++-v3/testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-26 Paolo Carlini @@ -35,4 +36,4 @@ namespace std template pair partition_copy(iterator_type, iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/pod.cc index de7b83d..aa5fed2 100644 --- a/libstdc++-v3/testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-26 Paolo Carlini @@ -32,6 +33,6 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template pair - partition_copy(iterator_type, iterator_type, + partition_copy(iterator_type, iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/2.cc index 05206d1..7d18728 100644 --- a/libstdc++-v3/testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-28 Paolo Carlini @@ -33,4 +34,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template iterator_type partition_point(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/pod.cc index 62fe877..d91955c 100644 --- a/libstdc++-v3/testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile { target c++11 } } // 2008-06-28 Paolo Carlini @@ -32,4 +33,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template iterator_type partition_point(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/2.cc index becb35f..b3c7f0c 100644 --- a/libstdc++-v3/testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // { dg-add-options using-deprecated } diff --git a/libstdc++-v3/testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/pod.cc index 280fcec..52a8db0 100644 --- a/libstdc++-v3/testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/pod.cc @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-options "-Wno-deprecated-declarations" } // { dg-add-options using-deprecated } // 2007-09-20 Benjamin Kosnik diff --git a/libstdc++-v3/testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/2.cc index 2d4a7c3..97085ff 100644 --- a/libstdc++-v3/testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -32,6 +33,6 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_unary_function predicate_type; - template iterator_type remove_copy_if(iterator_type, iterator_type, + template iterator_type remove_copy_if(iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/pod.cc index f1daeed..2e019bc 100644 --- a/libstdc++-v3/testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -31,6 +32,6 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_unary_function predicate_type; - template iterator_type remove_copy_if(iterator_type, iterator_type, + template iterator_type remove_copy_if(iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/2.cc index 2e6f90c..2a11026 100644 --- a/libstdc++-v3/testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -32,6 +33,6 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_unary_function predicate_type; - template iterator_type remove_if(iterator_type, iterator_type, + template iterator_type remove_if(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/pod.cc index 0dd8174..a1af922 100644 --- a/libstdc++-v3/testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -31,6 +32,6 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_unary_function predicate_type; - template iterator_type remove_if(iterator_type, iterator_type, + template iterator_type remove_if(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/2.cc index 2c20364..9f9ed21 100644 --- a/libstdc++-v3/testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -32,7 +33,7 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_unary_function predicate_type; - template iterator_type replace_copy_if(iterator_type, iterator_type, + template iterator_type replace_copy_if(iterator_type, iterator_type, iterator_type, predicate_type, const value_type&); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/pod.cc index c810aca..7c2c86f 100644 --- a/libstdc++-v3/testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -31,7 +32,7 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_unary_function predicate_type; - template iterator_type replace_copy_if(iterator_type, iterator_type, + template iterator_type replace_copy_if(iterator_type, iterator_type, iterator_type, predicate_type, const value_type&); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/2.cc index 9e8b313..54518a6 100644 --- a/libstdc++-v3/testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -34,4 +35,4 @@ namespace std template void replace_if(iterator_type, iterator_type, predicate_type, const value_type&); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/pod.cc index 184ab5a..513e35c 100644 --- a/libstdc++-v3/testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -33,4 +34,4 @@ namespace std template void replace_if(iterator_type, iterator_type, predicate_type, const value_type&); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/search/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/search/requirements/explicit_instantiation/2.cc index fda0490..847e5ca 100644 --- a/libstdc++-v3/testsuite/25_algorithms/search/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/search/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -32,9 +33,9 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_binary_function predicate_type; - template iterator_type search(iterator_type, iterator_type, + template iterator_type search(iterator_type, iterator_type, iterator_type, iterator_type); - template iterator_type search(iterator_type, iterator_type, + template iterator_type search(iterator_type, iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/search/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/search/requirements/explicit_instantiation/pod.cc index 5fcb5fc..3890d2a 100644 --- a/libstdc++-v3/testsuite/25_algorithms/search/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/search/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -31,9 +32,9 @@ namespace std typedef value_type* iterator_type; typedef std::pointer_to_binary_function predicate_type; - template iterator_type search(iterator_type, iterator_type, + template iterator_type search(iterator_type, iterator_type, iterator_type, iterator_type); - template iterator_type search(iterator_type, iterator_type, + template iterator_type search(iterator_type, iterator_type, iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/search_n/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/search_n/requirements/explicit_instantiation/2.cc index 1256ec6..4668695 100644 --- a/libstdc++-v3/testsuite/25_algorithms/search_n/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/search_n/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -33,9 +34,9 @@ namespace std typedef std::size_t size_type; typedef std::pointer_to_binary_function predicate_type; - template iterator_type search_n(iterator_type, iterator_type, + template iterator_type search_n(iterator_type, iterator_type, size_type, const value_type&); - template iterator_type search_n(iterator_type, iterator_type, + template iterator_type search_n(iterator_type, iterator_type, size_type, const value_type&, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/search_n/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/search_n/requirements/explicit_instantiation/pod.cc index 5bedc88..f32eba1 100644 --- a/libstdc++-v3/testsuite/25_algorithms/search_n/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/search_n/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -32,9 +33,9 @@ namespace std typedef std::size_t size_type; typedef std::pointer_to_binary_function predicate_type; - template iterator_type search_n(iterator_type, iterator_type, + template iterator_type search_n(iterator_type, iterator_type, size_type, const value_type&); - template iterator_type search_n(iterator_type, iterator_type, + template iterator_type search_n(iterator_type, iterator_type, size_type, const value_type&, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/2.cc index e8d4ca6..f2e4419 100644 --- a/libstdc++-v3/testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -33,4 +34,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template iterator_type stable_partition(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/pod.cc index 0982a73..e4e0980 100644 --- a/libstdc++-v3/testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -32,4 +33,4 @@ namespace std typedef std::pointer_to_unary_function predicate_type; template iterator_type stable_partition(iterator_type, iterator_type, predicate_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/transform/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/25_algorithms/transform/requirements/explicit_instantiation/2.cc index 8c765cb..484d705 100644 --- a/libstdc++-v3/testsuite/25_algorithms/transform/requirements/explicit_instantiation/2.cc +++ b/libstdc++-v3/testsuite/25_algorithms/transform/requirements/explicit_instantiation/2.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -37,4 +38,4 @@ namespace std operator1_type); template iterator_type transform(iterator_type, iterator_type, iterator_type, iterator_type, operator2_type); -} +} diff --git a/libstdc++-v3/testsuite/25_algorithms/transform/requirements/explicit_instantiation/pod.cc b/libstdc++-v3/testsuite/25_algorithms/transform/requirements/explicit_instantiation/pod.cc index dc56341..59c9730 100644 --- a/libstdc++-v3/testsuite/25_algorithms/transform/requirements/explicit_instantiation/pod.cc +++ b/libstdc++-v3/testsuite/25_algorithms/transform/requirements/explicit_instantiation/pod.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // 2007-09-20 Benjamin Kosnik @@ -36,4 +37,4 @@ namespace std operator1_type); template iterator_type transform(iterator_type, iterator_type, iterator_type, iterator_type, operator2_type); -} +} diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9178.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9178.cc index f81e2cd..c4e7c5e 100644 --- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9178.cc +++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9178.cc @@ -178,7 +178,7 @@ void test01() { transform(tmpstr.begin(), tmpstr.end(), back_inserter(str1), - bind1st(std::mem_fun(&std::wios::widen), &stream)); + bind1st(std::mem_fun(&std::wios::widen), &stream)); // { dg-warning "is deprecated" "" { target c++11 } } } fbuf1.sputn(str1.data(), str1.size()); diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_erase_if.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_erase_if.cc index fe239a2..7b7fd8f 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_erase_if.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_erase_if.cc @@ -61,7 +61,7 @@ main() // Now we erase all values that satisfy some predicate, in this case // one that returns true for all those larger than 500. - p.erase_if(bind1st(less(), 500)); + p.erase_if(bind1st(less(), 500)); // { dg-warning "is deprecated" "" { target c++11 } } // The largest value should be now 500. assert(p.top() == 500); diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_split_join.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_split_join.cc index dcca7a3..141359f 100644 --- a/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_split_join.cc +++ b/libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_split_join.cc @@ -101,7 +101,7 @@ main() cout <<* it << endl; // Now split the queues. - even_p.split(bind2nd(modulus(), 2), odd_p); + even_p.split(bind2nd(modulus(), 2), odd_p); // { dg-warning "is deprecated" "" { target c++11 } } // Check that each one contains the appropriate 10 values. diff --git a/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc b/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc index 3dd9ef5..1653ad4 100644 --- a/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc +++ b/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc @@ -17,6 +17,8 @@ // with this library; see the file COPYING3. If not see // . +// { dg-options "-Wno-deprecated-declarations" } + // 2.1 reference wrappers #include #include diff --git a/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/base_classes.cc b/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/base_classes.cc index 5deb50d..4fbdec9 100644 --- a/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/base_classes.cc +++ b/libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/base_classes.cc @@ -1,3 +1,4 @@ +// { dg-options "-Wno-deprecated-declarations" } // { dg-do compile } // Copyright (C) 2007-2022 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/util/regression/trait/erase_if_fn.hpp b/libstdc++-v3/testsuite/util/regression/trait/erase_if_fn.hpp index 8205d81..8189575 100644 --- a/libstdc++-v3/testsuite/util/regression/trait/erase_if_fn.hpp +++ b/libstdc++-v3/testsuite/util/regression/trait/erase_if_fn.hpp @@ -48,12 +48,14 @@ namespace __gnu_pbds { template struct regression_test_erase_if_fn - : public std::unary_function { private: typedef const T& const_reference; public: + typedef bool result_type; + typedef T argument_type; + bool operator()(const_reference r_t) const { @@ -64,7 +66,6 @@ namespace __gnu_pbds template struct regression_test_erase_if_fn > - : public std::unary_function, bool> { private: typedef const std::pair& const_reference; @@ -72,6 +73,9 @@ namespace __gnu_pbds typedef regression_test_erase_if_fn tl_erase_if_fn; public: + typedef bool result_type; + typedef std::pair argument_type; + bool operator()(const_reference r_t) const { diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h index 556aca1..252f6e4 100644 --- a/libstdc++-v3/testsuite/util/testsuite_iterators.h +++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h @@ -122,13 +122,18 @@ namespace __gnu_test */ template struct output_iterator_wrapper - : public std::iterator { protected: output_iterator_wrapper() : ptr(0), SharedInfo(0) { } public: + typedef std::output_iterator_tag iterator_category; + typedef T value_type; + typedef std::ptrdiff_t difference_type; + typedef T* pointer; + typedef T& reference; + typedef OutputContainer ContainerType; T* ptr; ContainerType* SharedInfo; @@ -209,8 +214,6 @@ namespace __gnu_test */ template class input_iterator_wrapper - : public std::iterator::type, - std::ptrdiff_t, T*, T&> { struct post_inc_proxy { @@ -228,6 +231,12 @@ namespace __gnu_test { } public: + typedef std::input_iterator_tag iterator_category; + typedef typename remove_cv::type value_type; + typedef std::ptrdiff_t difference_type; + typedef T* pointer; + typedef T& reference; + typedef BoundsContainer ContainerType; T* ptr; ContainerType* SharedInfo; -- 2.7.4