]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add attribute to features deprecated in C++17 [PR91260]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 11 Jan 2022 18:42:38 +0000 (18:42 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 14 Jan 2022 11:27:50 +0000 (11:27 +0000)
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.

99 files changed:
libstdc++-v3/include/backward/binders.h
libstdc++-v3/include/bits/refwrap.h
libstdc++-v3/include/bits/shared_ptr_base.h
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/bits/stl_function.h
libstdc++-v3/include/bits/stl_iterator.h
libstdc++-v3/include/bits/stl_iterator_base_types.h
libstdc++-v3/include/bits/stl_map.h
libstdc++-v3/include/bits/stl_multimap.h
libstdc++-v3/include/bits/stl_raw_storage_iter.h
libstdc++-v3/include/bits/stl_tempbuf.h
libstdc++-v3/include/bits/stream_iterator.h
libstdc++-v3/include/bits/streambuf_iterator.h
libstdc++-v3/include/ext/bitmap_allocator.h
libstdc++-v3/include/ext/functional
libstdc++-v3/include/ext/rope
libstdc++-v3/include/ext/throw_allocator.h
libstdc++-v3/include/std/type_traits
libstdc++-v3/include/tr1/functional
libstdc++-v3/include/tr1/functional_hash.h
libstdc++-v3/testsuite/20_util/function_objects/binders/1.cc
libstdc++-v3/testsuite/20_util/function_objects/binders/3113.cc
libstdc++-v3/testsuite/20_util/function_objects/constexpr.cc
libstdc++-v3/testsuite/20_util/raw_storage_iterator/base.cc
libstdc++-v3/testsuite/20_util/raw_storage_iterator/dr2127.cc
libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/base_classes.cc
libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/explicit_instantiation/1.cc
libstdc++-v3/testsuite/20_util/raw_storage_iterator/requirements/typedefs.cc
libstdc++-v3/testsuite/20_util/reference_wrapper/24803.cc
libstdc++-v3/testsuite/20_util/reference_wrapper/typedefs.cc
libstdc++-v3/testsuite/20_util/shared_ptr/comparison/less.cc
libstdc++-v3/testsuite/20_util/temporary_buffer.cc
libstdc++-v3/testsuite/21_strings/basic_string/cons/char/69092.cc
libstdc++-v3/testsuite/24_iterators/back_insert_iterator/requirements/base_classes.cc
libstdc++-v3/testsuite/24_iterators/front_insert_iterator/requirements/base_classes.cc
libstdc++-v3/testsuite/24_iterators/insert_iterator/requirements/base_classes.cc
libstdc++-v3/testsuite/24_iterators/istream_iterator/requirements/base_classes.cc
libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/92285.cc
libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/requirements/base_classes.cc
libstdc++-v3/testsuite/24_iterators/ostream_iterator/requirements/base_classes.cc
libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/requirements/base_classes.cc
libstdc++-v3/testsuite/24_iterators/reverse_iterator/requirements/base_classes.cc
libstdc++-v3/testsuite/25_algorithms/all_of/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/all_of/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/any_of/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/any_of/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/copy/34595.cc
libstdc++-v3/testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/copy_if/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/count_if/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/count_if/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/find_end/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/find_end/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/find_first_of/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/find_if/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/find_if/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/find_if_not/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/for_each/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/for_each/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/is_partitioned/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/is_permutation/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/minmax/3.cc
libstdc++-v3/testsuite/25_algorithms/none_of/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/none_of/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/partition/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/partition/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/partition_copy/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/partition_point/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/random_shuffle/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/remove_copy_if/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/remove_if/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/replace_copy_if/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/replace_if/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/search/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/search/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/search_n/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/search_n/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/stable_partition/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/25_algorithms/transform/requirements/explicit_instantiation/2.cc
libstdc++-v3/testsuite/25_algorithms/transform/requirements/explicit_instantiation/pod.cc
libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9178.cc
libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_erase_if.cc
libstdc++-v3/testsuite/ext/pb_ds/example/priority_queue_split_join.cc
libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc
libstdc++-v3/testsuite/tr1/6_containers/hash/requirements/base_classes.cc
libstdc++-v3/testsuite/util/regression/trait/erase_if_fn.hpp
libstdc++-v3/testsuite/util/testsuite_iterators.h

index b88e260e9a9388556a376dc771ee98e836b85536..5eac6c0881d16dbf6006051ce4a165fe0ce9825c 100644 (file)
@@ -131,6 +131,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// One of the @link binders binder functors@endlink.
   template<typename _Operation, typename _Tp>
+    _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<typename _Operation, typename _Tp>
+    _GLIBCXX11_DEPRECATED_SUGGEST("std::bind")
     inline binder2nd<_Operation>
     bind2nd(const _Operation& __fn, const _Tp& __x)
     {
index cc8beebab173df9780247119133e7bf61d5c3d46..8016f87478eb436ca35b5422ef7a8fa12804d585 100644 (file)
@@ -52,6 +52,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Res, typename... _ArgTypes>
     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<typename _Res, typename _T1>
     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<typename _Signature>
     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<typename _Res, typename _T1 _GLIBCXX_NOEXCEPT_PARM>
     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
index e16a9250592fa44c889191aff1c01e4329a8f08b..9e80aabcda87700613da5dbe07e5d9c13373e885 100644 (file)
@@ -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<typename _Tp, typename _Tp1>
     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<void, void>
index f74501f9f26164c3ac3b1588e6e0ace3c4745740..75f38812807aa724375d68722c423d93b01d253c 100644 (file)
@@ -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<std::random_access_iterator_tag, bool>
   {
@@ -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
   {
index ab8a5a1bb3a4db1ee0795f9d1651599a7b7447dd..a1a770dc2dec637d769d18e50a1d6b77c4498c2b 100644 (file)
@@ -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<typename _Tp>
     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<typename _Tp>
     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<typename _Tp>
     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<typename _Tp>
@@ -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<typename _Predicate>
-    class unary_negate
+    class _GLIBCXX17_DEPRECATED unary_negate
     : public unary_function<typename _Predicate::argument_type, bool>
     {
     protected:
@@ -1020,6 +1040,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// One of the @link negators negation functors@endlink.
   template<typename _Predicate>
+    _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<typename _Predicate>
-    class binary_negate
+    class _GLIBCXX17_DEPRECATED binary_negate
     : public binary_function<typename _Predicate::first_argument_type,
                             typename _Predicate::second_argument_type, bool>
     {
@@ -1048,6 +1069,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   /// One of the @link negators negation functors@endlink.
   template<typename _Predicate>
+    _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<typename _Arg, typename _Result>
+    _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<typename _Arg1, typename _Arg2, typename _Result>
+    _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<typename _Ret, typename _Tp>
@@ -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<typename _Ret, typename _Tp>
@@ -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<typename _Ret, typename _Tp>
@@ -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<typename _Ret, typename _Tp, typename _Arg>
@@ -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<typename _Ret, typename _Tp, typename _Arg>
@@ -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<typename _Ret, typename _Tp, typename _Arg>
@@ -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<typename _Ret, typename _Tp, typename _Arg>
@@ -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<typename _Ret, typename _Tp>
+    _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<typename _Ret, typename _Tp>
+    _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<typename _Ret, typename _Tp>
+    _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<typename _Ret, typename _Tp>
+    _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<typename _Ret, typename _Tp, typename _Arg>
+    _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<typename _Ret, typename _Tp, typename _Arg>
+    _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<typename _Ret, typename _Tp, typename _Arg>
+    _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<typename _Ret, typename _Tp, typename _Arg>
+    _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
 
   /** @}  */
 
index 24c106e0f70486c667dc3414c94d7acc5e80ef43..549a391d04de9adb80230a82510199ad4dda91b4 100644 (file)
@@ -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.
index 964bbafec6ce942dae11c0211ca50f32b39cf3a1..9eecd1dd855c5728f1b7bcc0e6f5af681ab1a059 100644 (file)
@@ -124,7 +124,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   */
   template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
            typename _Pointer = _Tp*, typename _Reference = _Tp&>
-    struct iterator
+    struct _GLIBCXX17_DEPRECATED iterator
     {
       /// One of the @link iterator_tags tag types@endlink.
       typedef _Category  iterator_category;
index 5b477f514d225bcddc47219a233458770280afdf..625760d0c298443f86afbafbc61afb3ec9a5dfb3 100644 (file)
@@ -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<value_type, value_type, bool>
       {
@@ -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.
index 4375f5e7dbb21bce8f11ce2420d19a5ce616c154..f6b08bca3f3ecd6539dae563fcbc289a7f1e5915 100644 (file)
@@ -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<value_type, value_type, bool>
       {
@@ -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.
index d4e25528dc304f973d5a9623353aab6eeaf32486..063c01c676d3a5978f5a6970b97aa9ca25f6b8a7 100644 (file)
@@ -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 _OutputIterator, class _Tp>
-    class raw_storage_iterator
+    class _GLIBCXX17_DEPRECATED raw_storage_iterator
     : public iterator<output_iterator_tag, void, void, void, void>
     {
     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
index b52390f29778d3002ce3e1e51196947779b181ea..654c6a807478205793b897ab7667bf42ed9ef4e1 100644 (file)
@@ -96,6 +96,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    * Provides the nothrow exception guarantee.
    */
   template<typename _Tp>
+    _GLIBCXX14_DEPRECATED
     pair<_Tp*, ptrdiff_t>
     get_temporary_buffer(ptrdiff_t __len) _GLIBCXX_NOEXCEPT
     {
index e21875aabdf60d24e8af89879af3aea2807ea15e..86c5845b8355ef640ad179b7b79527f0dc718384 100644 (file)
@@ -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 _Tp, typename _CharT = char,
            typename _Traits = char_traits<_CharT>, typename _Dist = ptrdiff_t>
@@ -256,6 +260,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       operator++(int) _GLIBCXX_NOEXCEPT
       { return *this; }
     };
+#pragma GCC diagnostic pop
 
   /// @} group iterators
 
index e1a2d1731df7079f8a449d55ed42c2dfa028b3ae..72344c630880243b7a65cb3a8e6ed8ac74478d93 100644 (file)
@@ -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<typename _CharT, typename _Traits>
@@ -326,6 +329,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        return *this;
       }
     };
+#pragma GCC diagnostic pop
 
   // Overloads for streambuf iterators.
   template<typename _CharT>
index 3edfce97b7d8198f9b2a7505e884985a82c9bb8e..033f132148a6e96e275e8ce2bf3694819e543153 100644 (file)
@@ -277,7 +277,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     // _Tp should be a pointer type.
     template<typename _Tp>
       class _Inclusive_between 
-      : public std::unary_function<typename std::pair<_Tp, _Tp>, 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<typename _Functor>
       class _Functor_Ref 
-      : public std::unary_function<typename _Functor::argument_type, 
-                                  typename _Functor::result_type>
       {
        _Functor& _M_fref;
        
@@ -327,16 +324,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     // the vector.
     template<typename _Tp>
       class _Ffit_finder 
-      : public std::unary_function<typename std::pair<_Tp, _Tp>, 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)
        { }
 
index cebf86dadabb7fb43ee1253e45a11daed4310bc4..19cd8d5b56312f6078949b7773f0bf67bcba5be5 100644 (file)
@@ -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.
index 303f1d982efdf9230a7935b2802eb5219b77bca6..f8af374f042d02d2f1dc2ef64f5c033f4f39a46f 100644 (file)
@@ -171,6 +171,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // behave a little like basic_ostringstream<sequence::value_type> and a
   // little like containers.
 
+// Ignore warnings about std::iterator.
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
   template<class _Sequence, std::size_t _Buf_sz = 100>
     class sequence_buffer
     : public std::iterator<std::output_iterator_tag, void, void, void, void>
@@ -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<class _CharT>
@@ -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<class _CharT, class _Alloc>
@@ -443,6 +451,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                 const rope<_CharT, _Alloc>& __y)
       { return __x + __y; }
     };
+#pragma GCC diagnostic pop
 
   template <class _CharT, class _Alloc>
     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 _CharT, class _Alloc>
     class _Rope_iterator_base
     : public std::iterator<std::random_access_iterator_tag, _CharT>
@@ -1136,6 +1148,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          }
       }
     };
+#pragma GCC diagnostic pop
 
   template<class _CharT, class _Alloc>
     class _Rope_iterator;
index 870242ccf25127506783a06481ccbf0835c3abd2..220f5f5243f913081843dbc4fbed4ddcb95198d1 100644 (file)
@@ -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
 
index 7d92d7e6458f47df48b30e90e2798762b97d4f14..75f50e34a06ce1150170c3334fb2b9ead776a649 100644 (file)
@@ -2594,7 +2594,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Functor, typename... _ArgTypes>
     struct result_of<_Functor(_ArgTypes...)>
     : public __invoke_result<_Functor, _ArgTypes...>
-    { };
+    { } _GLIBCXX17_DEPRECATED_SUGGEST("std::invoke_result");
 
 #if __cplusplus >= 201402L
   /// Alias template for aligned_storage
index c4cfc4578180e1fe58d4183494b532b1adb282eb..83d22bed9e5a6fb9ba6ff7fdd34b7fea0b65ecce 100644 (file)
@@ -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<typename _Tp>
     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<typename _Res, typename... _ArgTypes>
     function<_Res(_ArgTypes...)>::
index 6a0f75b88589cb9f53d4886cdbf46d65c558a3e1..0146cd792f86172607e38c3d65af5f58af9b305b 100644 (file)
@@ -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<T> 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<size_t>(__p); }
     };
+#pragma GCC diagnostic pop
 
   /// Explicit specializations for integer types.
 #define _TR1_hashtable_define_trivial_hash(_Tp)        \
index 3d196182d9aa752b1d7fa523d5f40334e286cd61..35d6050814abbf5207237f513acf0de06b21ee7e 100644 (file)
@@ -17,6 +17,7 @@
 
 // 20.3.6 Binders
 
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 #include <functional>
index 8944d155b8dc286ef1c14551f9fbf52a4ed244f7..23c7d0dbc5ac36cb54a8b8b0c6fc9e3ecaa50416 100644 (file)
@@ -17,6 +17,7 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-add-options using-deprecated }
 
 // 20.3.6 Binders
index 7072edecf52e32f1d03eab166ac51eb7c3ee1314..8ff6dd187d7faa3e777775413abd386537df830d 100644 (file)
@@ -67,10 +67,12 @@ static_assert(std::bit_or<void>()(1,2)==3, "");
 static_assert(std::bit_xor<void>()(1,1)==0, "");
 static_assert(std::bit_not<void>()(std::bit_not<void>()(0))==0, "");
 
-static_assert(std::unary_negate<std::logical_not<int>>
-             (std::logical_not<int>())(1), "");
-static_assert(std::not1(std::logical_not<int>())(1), "");
+static_assert(std::unary_negate< // { dg-warning "is deprecated" "" { target c++17 } }
+             std::logical_not<int>
+             >(std::logical_not<int>())(1), "");
+static_assert(std::not1(std::logical_not<int>())(1), ""); // { dg-warning "is deprecated" "" { target c++17 } }
 
-static_assert(std::binary_negate<std::logical_and<int>>
-             (std::logical_and<int>())(0,0), "");
-static_assert(std::not2(std::logical_and<int>())(0,0), "");
+static_assert(std::binary_negate< // { dg-warning "is deprecated" "" { target c++17 } }
+             std::logical_and<int>
+             >(std::logical_and<int>())(0,0), "");
+static_assert(std::not2(std::logical_and<int>())(0,0), ""); // { dg-warning "is deprecated" "" { target c++17 } }
index 7467653b06c36016ad6a370dd4790efdb75d2c3d..95a901260759ef4d240b03bed13c4467c1fce00a 100644 (file)
@@ -15,7 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-do run { target c++11 } }
+// { dg-do run }
 
 #include <memory>
 #include <testsuite_hooks.h>
@@ -24,7 +24,7 @@ void
 test01()
 {
   int a[2];
-  auto it = std::raw_storage_iterator<int*, int>(a);
+  std::raw_storage_iterator<int*, int> it(a); // { dg-warning "is deprecated" "" { target c++17 } }
   VERIFY( it.base() == a );
   VERIFY( (++it).base() == a+1 );
 }
index d1e5bf080d033da3e9160d7f962f07dc6d575191..b31d3fe94243825ce8bf3d9fe822a3942b131460 100644 (file)
@@ -32,7 +32,7 @@ test01()
 {
   char buf[sizeof(MoveOnly)*2];
   MoveOnly* addr = (MoveOnly*)buf;
-  std::raw_storage_iterator<MoveOnly*, MoveOnly> iter(addr);
+  std::raw_storage_iterator<MoveOnly*, MoveOnly> iter(addr); // { dg-warning "is deprecated" "" { target c++17 } }
   *iter++ = MoveOnly{1};
   *iter++ = MoveOnly{2};
   VERIFY( addr[0].i == 1 );
index 25f7f529a132ee5320ad3f82807224a8d5724d1d..52947f2c1674554d1b24954aed65612eec950120 100644 (file)
@@ -29,8 +29,8 @@ void test01()
 
   // Check for required base class.
   long l;
-  typedef raw_storage_iterator<long*, long> test_iterator;
-  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
+  typedef raw_storage_iterator<long*, long> test_iterator;                     // { dg-warning "is deprecated" "" { target c++17 } }
+  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator; // { dg-warning "is deprecated" "" { target c++17 } }
   test_iterator rs_it(&l);
   base_iterator* base __attribute__((unused)) = &rs_it;
 }
index 9e5c04daf33d7f785817388eb33ade0c7fd2227f..9cd713f29ad89771bfe602d7e23f4743c252cf30 100644 (file)
@@ -22,4 +22,4 @@
 
 #include <memory>
 
-template class std::raw_storage_iterator<int*, int>;
+template class std::raw_storage_iterator<int*, int>; // { dg-warning "is deprecated" "" { target c++17 } }
index 7ede28870b5f544d20dba73c5b1195e911fdc6e0..ede9f13c29d8a24c75c3c45fbe4bce336c5ce085 100644 (file)
@@ -27,7 +27,7 @@ void test01()
   using namespace std;
 
   // Check for required typedefs
-  typedef raw_storage_iterator<long*, long> test_iterator;
+  typedef raw_storage_iterator<long*, long> 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;
index 98a8d7eec8e46a5c40a1b392c1467b387d58bb11..91441f8332993cb8f3c227931f07539eb3e98d69 100644 (file)
@@ -28,12 +28,12 @@ struct test_type
    int cmember2(char)const;
 };
 
-struct functor1 : public std::unary_function<int, double>
+struct functor1 : public std::unary_function<int, double> // { dg-warning "is deprecated" }
 {
   double operator()(int) const;
 };
 
-struct functor2 : public std::binary_function<int, char, double>
+struct functor2 : public std::binary_function<int, char, double> // { dg-warning "is deprecated" }
 {
    double operator()(int, char) const;
 };
index 012081746755476c24e4e0183a3a5c6d90c07f96..a8f3fb244e8a3b0af478d6740b7666190277fd88 100644 (file)
@@ -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.
 //
 #include <functional>
 #include <type_traits>
 
+namespace __gnu_test
+{
+
+template<typename T> 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<typename U> using not_found = std::is_same<U, none>;
+// A nested type needs to match the expected type.
+template<typename U, typename V> using found = std::is_same<U, V>;
+#else
+// For C++20 the nested type should always be not found.
+template<typename U> using not_found = std::true_type;
+// Any nested type is bad.
+template<typename U, typename V> using found = std::false_type;
+#endif
+
+template<typename T, typename U, typename = void>
+struct check_result_type
+: not_found<U>
+{ };
+
+// Matches when reference_wrapper<T>::result_type exists
+template<typename T, typename U>
+struct check_result_type<T, U, void_t<typename std::reference_wrapper<T>::result_type>>
+: found<U, typename std::reference_wrapper<T>::result_type>
+{ };
+
+template<typename T, typename U, typename = void>
+struct check_arg_type
+: not_found<U>
+{ };
+
+// Matches when reference_wrapper<T>::argument_type exists
+template<typename T, typename U>
+struct check_arg_type<T, U, void_t<typename std::reference_wrapper<T>::argument_type>>
+: found<U, typename std::reference_wrapper<T>::argument_type>
+{ };
+
+template<typename T, typename U, typename = void>
+struct check_first_arg_type
+: not_found<U>
+{ };
+
+// Matches when reference_wrapper<T>::first_argument_type exists
+template<typename T, typename U>
+struct check_first_arg_type<T, U, void_t<typename std::reference_wrapper<T>::first_argument_type>>
+: found<U, typename std::reference_wrapper<T>::first_argument_type>
+{ };
+
+template<typename T, typename U, typename = void>
+struct check_second_arg_type
+: not_found<U>
+{ };
+
+// Matches when reference_wrapper<T>::second_argument_type exists
+template<typename T, typename U>
+struct check_second_arg_type<T, U, void_t<typename std::reference_wrapper<T>::second_argument_type>>
+: found<U, typename std::reference_wrapper<T>::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<reference_wrapper<int_result_type>::result_type, int>::value, "has result_type" );
-  static_assert( is_same<reference_wrapper<derives_unary>::result_type, int>::value, "has result_type" );
-  static_assert( is_same<reference_wrapper<derives_binary>::result_type, int>::value, "has result_type" );
-  static_assert( is_same<reference_wrapper<derives_unary_binary>::result_type, int>::value, "has result_type" );
-  static_assert( is_same<reference_wrapper<int(void)>::result_type, int>::value, "has result_type" );
-  static_assert( is_same<reference_wrapper<int(*)(void)>::result_type, int>::value, "has result_type" );
-  static_assert( is_same<reference_wrapper<int (::X::*)()>::result_type, int>::value, "has result_type" );
-  static_assert( is_same<reference_wrapper<int (::X::*)(float)>::result_type, int>::value, "has result_type" );
+  static_assert( check_result_type<int_result_type, int>::value, "has result_type" );
+  static_assert( check_result_type<derives_unary, int>::value, "has result_type" );
+  static_assert( check_result_type<derives_binary, int>::value, "has result_type" );
+  static_assert( check_result_type<derives_unary_binary, int>::value, "has result_type" );
+  static_assert( check_result_type<int(void), int>::value, "has result_type" );
+  static_assert( check_result_type<int(*)(void), int>::value, "has result_type" );
+  static_assert( check_result_type<int (::X::*)(), int>::value, "has result_type" );
+  static_assert( check_result_type<int (::X::*)(float), int>::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<int_result_type, none>::value, "" );
+  static_assert( check_arg_type<derives_unary, int>::value, "" );
+  static_assert( check_arg_type<derives_binary, none>::value, "" );
+  static_assert( check_arg_type<derives_unary_binary, int>::value, "" );
+  static_assert( check_arg_type<int(void), none>::value, "" );
+  static_assert( check_arg_type<int(*)(void), none>::value, "" );
+  static_assert( check_arg_type<int (::X::*)(), X*>::value, "" );
+  static_assert( check_arg_type<int (::X::*)() const, const X*>::value, "" );
+  static_assert( check_arg_type<int (::X::*)(float), none>::value, "" );
+  static_assert( check_arg_type<int (::X::*)(char, char), none>::value, "" );
+
+  // Check first_argument_type typedef
+  static_assert( check_first_arg_type<int_result_type, none>::value, "" );
+  static_assert( check_first_arg_type<derives_unary, none>::value, "" );
+  static_assert( check_first_arg_type<derives_binary, int>::value, "" );
+  static_assert( check_first_arg_type<derives_unary_binary, int>::value, "" );
+  static_assert( check_first_arg_type<int(void), none>::value, "" );
+  static_assert( check_first_arg_type<int(*)(void), none>::value, "" );
+  static_assert( check_first_arg_type<int (::X::*)(), none>::value, "" );
+  static_assert( check_first_arg_type<int (::X::*)(float), X*>::value, "" );
+  static_assert( check_first_arg_type<int (::X::*)(float) const, const X*>::value, "" );
+  static_assert( check_first_arg_type<int (::X::*)(char, char), none>::value, "" );
+
+  // Check second_argument_type typedef
+  static_assert( check_second_arg_type<int_result_type, none>::value, "" );
+  static_assert( check_second_arg_type<derives_unary, none>::value, "" );
+  static_assert( check_second_arg_type<derives_binary, float>::value, "" );
+  static_assert( check_second_arg_type<derives_unary_binary, float>::value, "" );
+  static_assert( check_second_arg_type<int(void), none>::value, "" );
+  static_assert( check_second_arg_type<int(*)(void), none>::value, "" );
+  static_assert( check_second_arg_type<int (::X::*)(), none>::value, "" );
+  static_assert( check_second_arg_type<int (::X::*)(float), float>::value, "" );
+  static_assert( check_second_arg_type<int (::X::*)(float) const, float>::value, "" );
+  static_assert( check_second_arg_type<int (::X::*)(char, char), none>::value, "" );
 }
 
 int main()
 {
   test01();
-  return 0;
 }
index 049b19cb11087dee6d270caa09c93938adec50dd..5061e995cc9807b85c8f03c9ee44f3c9f6e32fa7 100644 (file)
@@ -27,7 +27,7 @@ struct A { };
 namespace std
 {
   template<>
-    struct less<A*> : binary_function<A*,A*,bool>
+    struct less<A*>
     {
       static int count;
       bool operator()(A* l, A* r) { ++count; return l < r; }
index 3625074d66c7da515f4f71fa008fa7e05fdc86e1..3f3625961b62a4afea5726691ab3938d18b3d1ab 100644 (file)
@@ -27,7 +27,7 @@ struct junk { char j[12]; };
 int main(void)
 {
   typedef std::pair<junk*, std::ptrdiff_t> pair_type;
-  pair_type results = std::get_temporary_buffer<junk>(5);
+  pair_type results = std::get_temporary_buffer<junk>(5); // { dg-warning "deprecated" "" { target c++14 } }
 
   if (results.second != 0)
   {
index 2faf3808c0bd510a7da6437cc19e9b3c04c7e49e..5279e4398e8c0849a1c0f4652536fadfaa778a39 100644 (file)
 #include <string>
 #include <iterator>
 
-struct hate_T_iterator : std::iterator<std::forward_iterator_tag, char> {
+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;
 
index 1b7ad89bf716052c5b622e79fa14fcdb9f29e20e..3a3208ab48583e5f8b986aa08e497d9f9c28bf1d 100644 (file)
@@ -30,7 +30,7 @@ void test01()
   // Check for required base class.
   list<int> l;
   typedef back_insert_iterator<list<int> > test_iterator;
-  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
+  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator; // { dg-warning "is deprecated" "" { target c++17 } }
   test_iterator  r_it(l);
   base_iterator* base __attribute__((unused)) = &r_it;
 }
index d310e056ab47439fd58a04edb9ae6bbd4002b99f..7fd4932947a6bf9dfc3a3266bc001bdacf4ad065 100644 (file)
@@ -30,7 +30,7 @@ void test01()
   // Check for required base class.
   list<int> l;
   typedef front_insert_iterator<list<int> > test_iterator;
-  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
+  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator; // { dg-warning "is deprecated" "" { target c++17 } }
   test_iterator  r_it(l);
   base_iterator* base __attribute__((unused)) = &r_it;
 }
index 85bd82d9f6bc5beb231372a9fcea6c0a8e1fbefd..eafb6b24f9987562c8b55d7f9856a8f310044424 100644 (file)
@@ -32,7 +32,7 @@ void test01()
   list<int>::iterator li = l.begin();
 
   typedef insert_iterator<list<int> > test_iterator;
-  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
+  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator; // { dg-warning "is deprecated" "" { target c++17 } }
   test_iterator  r_it(l, li);
   base_iterator* base __attribute__((unused)) = &r_it;
 }
index 8bcc6712f8b48062319cb322c1ffe6a397089c5e..a3d395283825deeadefa57c2a01fe892104d2105 100644 (file)
@@ -30,7 +30,7 @@ void test01()
 
   // Check for required base class.
   typedef istream_iterator<long> test_iterator;
-  typedef iterator<input_iterator_tag, long, ptrdiff_t, const long*, 
+  typedef iterator<input_iterator_tag, long, ptrdiff_t, const long*, // { dg-warning "is deprecated" "" { target c++17 } }
                   const long&> base_iterator;
   test_iterator  r_it;
   base_iterator* base __attribute__((unused)) = &r_it;
index 5a3dc1241db4b9e2586b47b2bef34c643333d041..07f46a99ed3d54450a1143d75863a4f3514a72a7 100644 (file)
@@ -24,8 +24,8 @@
 
 typedef std::input_iterator_tag category;
 typedef std::char_traits<char>::off_type off_type;
-typedef std::iterator<category, char, off_type, char*, char> good;
-typedef std::iterator<category, char, off_type, char*, char&> bad;
+typedef std::iterator<category, char, off_type, char*, char> good; // { dg-warning "is deprecated" "" { target c++17 } }
+typedef std::iterator<category, char, off_type, char*, char&> bad; // { dg-warning "is deprecated" "" { target c++17 } }
 
 bool check(good&) { return true; }
 void check(bad&) { }
index c8a2deb698f4e23806c6a63e79615af62e92fca5..3540362d56ea2ff9f64e0c78abb577ece4fb27fe 100644 (file)
@@ -32,8 +32,9 @@ void test01()
   typedef istreambuf_iterator<char> test_iterator;
   typedef char_traits<char>::off_type off_type;
 
-  // This is the base class required since LWG 445, which differs from C++03:
-  typedef iterator<input_iterator_tag, char, off_type, char*, char>
+  // 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<input_iterator_tag, char, off_type, char*, char> // { dg-warning "is deprecated" "" { target c++17 } }
     base_iterator;
 
   istringstream isstream("this tag");
index 23d89883638194843c242e9e5d20a301d6236ec6..a979ac9f95f08ab80831c6fbf93e6dfc7720a22e 100644 (file)
@@ -30,7 +30,7 @@ void test01()
 
   // Check for required base class.
   typedef ostream_iterator<long> test_iterator;
-  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
+  typedef iterator<output_iterator_tag, void, void, void, void> 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;
index def29e02d9d2f3695dfedf0dacf8016fd8ae20b3..c7cfd805a842f8601a8e88f1584fca3c5e10fa01 100644 (file)
@@ -30,7 +30,7 @@ void test01()
 
   // Check for required base class.
   typedef ostreambuf_iterator<char> test_iterator;
-  typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
+  typedef iterator<output_iterator_tag, void, void, void, void> 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;
index 4b3322ea36ca2358602893a822192c69f913ddbf..4de138c0c5d5a98dacbf0089982d3dcc09485b1b 100644 (file)
@@ -29,7 +29,7 @@ void test01()
   // Check for required base class.
   long l;
   typedef reverse_iterator<long*> test_iterator;
-  typedef iterator<iterator_traits<long*>::iterator_category,
+  typedef iterator<iterator_traits<long*>::iterator_category, // { dg-warning "is deprecated" "" { target c++17 } }
                   iterator_traits<long*>::value_type,
                   iterator_traits<long*>::difference_type,
                   iterator_traits<long*>::pointer,
index 4724eb9f2e5d84a2b4b530a66d0c9914382d162f..d2ff02896ded6ffe2a51af695e527615a2b9ed63 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -33,4 +34,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template bool all_of(iterator_type, iterator_type, predicate_type);
-} 
+}
index ecd6abe8983563fb3c13bf5cdc9a5efe46cd8112..5cc29a6dfb7fb9ff6b331cda103c1d6128c89715 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -32,4 +33,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template bool all_of(iterator_type, iterator_type, predicate_type);
-} 
+}
index ad306f70c5cc5ab1afd372f09ddca58e3a10b9f7..910b1173049efaa4842c419dc62f357349c75e3d 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -33,4 +34,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template bool any_of(iterator_type, iterator_type, predicate_type);
-} 
+}
index 17d139986e77707e9f795433212f62d7bdd37ff9..d170961314270adb8d00322911766a737d83b19e 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -32,4 +33,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template bool any_of(iterator_type, iterator_type, predicate_type);
-} 
+}
index b1525ee057b707bbcea30428301409549858368b..d9bd3b6ea7d3fcc8346a3a45c06033db06b1e537 100644 (file)
@@ -21,7 +21,7 @@
 #include <testsuite_hooks.h>
 
 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:
index 4cd47a670be834f724de7dd6c6a9e40c277d6000..975c946cb727fd1a6ca68701a92f7915f7049c5f 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -32,6 +33,6 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
-  template iterator_type copy_if(iterator_type, iterator_type, 
+  template iterator_type copy_if(iterator_type, iterator_type,
                                 iterator_type, predicate_type);
-} 
+}
index 04a9a6f015fa12072fb68320ff1b304259418bff..3f58dc53d588eaeef7954083d13ae80985524e98 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-24  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -31,6 +32,6 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
-  template iterator_type copy_if(iterator_type, iterator_type, 
+  template iterator_type copy_if(iterator_type, iterator_type,
                                 iterator_type, predicate_type);
-} 
+}
index 8d531bc5addaa2ca586597b95e092e096963e64a..7431baf430158f3b2af2e426b867331caa6c2051 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -34,4 +35,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template difference_type count_if(iterator_type, iterator_type, predicate_type);
-} 
+}
index 7fba3c6959edc16757486f54ad815d0df108593c..2699d29075bcc5d12720360c5c4a2c266c848a57 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -33,4 +34,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template difference_type count_if(iterator_type, iterator_type, predicate_type);
-} 
+}
index 693a991d726e174de72002c75816649b2f46bbc0..d2a0479af03790df77dc3a736cd671a3ad68d7af 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -38,4 +39,4 @@ namespace std
   template iterator_type find_end(iterator_type, iterator_type,
                                  iterator_type, iterator_type,
                                  predicate_type);
-} 
+}
index ac46bebc2702e667086b75895e49a3646592c412..684152a0cf344596511ccbc812d5c166c79b0b96 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-do compile }
+// { dg-additional-options "-Wno-deprecated-declarations" { target c++11 } }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
 
@@ -37,4 +38,4 @@ namespace std
   template iterator_type find_end(iterator_type, iterator_type,
                                  iterator_type, iterator_type,
                                  predicate_type);
-} 
+}
index 96a4f6eb13400b89154d1015fd4ad573f98fd642..6dd6f9f7b7b80a33b319c719c20bec302ae3e9b1 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-do compile }
+// { dg-additional-options "-Wno-deprecated-declarations" { target c++11 } }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
 
@@ -38,4 +39,4 @@ namespace std
   template iterator_type find_first_of(iterator_type, iterator_type,
                                       iterator_type, iterator_type,
                                       predicate_type);
-} 
+}
index 4749298ca5b0180a1085965f336590343a01d370..8ec2b21ebdbd7244c8614026fb46bebef4edaf67 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-do compile }
+// { dg-additional-options "-Wno-deprecated-declarations" { target c++11 } }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
 
@@ -37,4 +38,4 @@ namespace std
   template iterator_type find_first_of(iterator_type, iterator_type,
                                       iterator_type, iterator_type,
                                       predicate_type);
-} 
+}
index 66c512eb4df4621ab12a123021e8ec5a4b42b450..f3cd559f49c3006018dcc95c196f278e72eccbcf 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -33,4 +34,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template iterator_type find_if(iterator_type, iterator_type, predicate_type);
-} 
+}
index d603e4299010fdc0bf1f3b75230568df81de2f7c..2326cb869259ca58898dd332930ef2a43e068e2f 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -32,4 +33,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template iterator_type find_if(iterator_type, iterator_type, predicate_type);
-} 
+}
index 3326784ce44bfa719810ff2aed54e28c6df2aa7c..9f87232909bfd19e2139aeb12bec6af37b6c775b 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -33,4 +34,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template iterator_type find_if_not(iterator_type, iterator_type, predicate_type);
-} 
+}
index 63f288682c3e3ee959a81bb9ae90cb68b0edf83d..042eacef0ac163d62179ca922f918b6b1f3e2ca5 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -32,4 +33,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template iterator_type find_if_not(iterator_type, iterator_type, predicate_type);
-} 
+}
index 51b1d936d8fcf19648bec3cf298f95e5bef83267..f7e09f8acb418886c0a9f31136ac720f21c1570f 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -32,6 +33,6 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_unary_function<value_type, void> function_type;
 
-  template function_type for_each(iterator_type, iterator_type, 
+  template function_type for_each(iterator_type, iterator_type,
                                  function_type);
-} 
+}
index ce28d6cb5b0b3f9f3a5f302b3ccb5d5c4a32c221..eb2ddaf4a1293bc02034db67a8b6a2cdeb5de297 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -31,6 +32,6 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_unary_function<value_type, void> function_type;
 
-  template function_type for_each(iterator_type, iterator_type, 
+  template function_type for_each(iterator_type, iterator_type,
                                  function_type);
-} 
+}
index 80e22fe5c5efddc62fcafe862137ed9fa68ce371..7be1f402372f0148be8162652346c2b19252550e 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-27  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -33,4 +34,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template bool is_partitioned(iterator_type, iterator_type, predicate_type);
-} 
+}
index 678c2029651b93f750962cde83216c6c1efa41dd..2cc9e806a14063d913a10e8817844435e346e5a6 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-27  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -32,4 +33,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template bool is_partitioned(iterator_type, iterator_type, predicate_type);
-} 
+}
index 1a67e1121ff2641e09d6cf19f13068e2d60da5c4..8940b4dbe3747ca3ed79d64d9fd884cca4bab9db 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2011-01-13  Paolo Carlini  <paolo.carlini@oracle.com>
index 60c5043132b0e3c7695360d64bc3ead8744be216..d7b38c999ec63b1b81663b3f804d19c5af8fe45e 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2011-01-13  Paolo Carlini  <paolo.carlini@oracle.com>
index 2e849cf2dcea087d123fb65a9819d0ecf173c308..73e0c3382a47072e0eb26b90efb68a948375b955 100644 (file)
 #include <testsuite_hooks.h>
 
 struct compare_counter
-  : std::binary_function<int, int, bool>
 {
+  typedef int result_type;
+  typedef int first_argument_type;
+  typedef bool second_argument_type;
+
   static int count;
   
   bool operator()(int a, int b) const
index f5aaf308efee8a3a685ffcbea92fbfe890b484fd..e4460da245831cbb2d0aeb67c65ffa56046d668a 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -33,4 +34,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template bool none_of(iterator_type, iterator_type, predicate_type);
-} 
+}
index 40b165fc7e4041acd9a98e18472d1a3e05c18411..52e6dbb86f609a29a22bd480a2bea10fb1dbff92 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -32,4 +33,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template bool none_of(iterator_type, iterator_type, predicate_type);
-} 
+}
index 424459073086f8489bb56d2282959f246152937a..a2b97ba585ccbe69db98253d12cdc0ff829b1781 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -34,4 +35,4 @@ namespace std
 
   template iterator_type partition(iterator_type, iterator_type,
                                   predicate_type);
-} 
+}
index 5b143f3b06851983ae8de43d1502622d4c4c3e4f..4d9a8e4e3d5ac7271ec73ac1ab63e5c8c3dbaab4 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -33,4 +34,4 @@ namespace std
 
   template iterator_type partition(iterator_type, iterator_type,
                                   predicate_type);
-} 
+}
index 994a3c533c945dd48f45be67f8cb34d4ce7e52de..e8924b4f4cf6949c4487a17edf3d884159c95953 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-26  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -35,4 +36,4 @@ namespace std
   template pair<iterator_type, iterator_type>
     partition_copy(iterator_type, iterator_type,
                   iterator_type, iterator_type, predicate_type);
-} 
+}
index de7b83da964d8a99144c9087099ac57f125956a0..aa5fed21d2644d1f9e54fbc052ebab3351a15927 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-26  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -32,6 +33,6 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template pair<iterator_type, iterator_type>
-    partition_copy(iterator_type, iterator_type, 
+    partition_copy(iterator_type, iterator_type,
                   iterator_type, iterator_type, predicate_type);
-} 
+}
index 05206d1a6e50a90cfa700d93b706ba2d92a088bd..7d18728c92aa5adcc9ecdb44989638ab41a9e6c0 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-28  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -33,4 +34,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template iterator_type partition_point(iterator_type, iterator_type, predicate_type);
-} 
+}
index 62fe8773d9a0eee57099822a539bf0b5c536c8c8..d91955c452cba2b4a77b18faa4f2cdf1efdc6669 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile { target c++11 } }
 
 // 2008-06-28  Paolo Carlini  <paolo.carlini@oracle.com>
@@ -32,4 +33,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template iterator_type partition_point(iterator_type, iterator_type, predicate_type);
-} 
+}
index becb35f2b7a13f4a9c82ab8fa3e93ac6a76dd241..b3c7f0c01f0cc6cafdaff8ce47087de87ceedd48 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 // { dg-add-options using-deprecated }
 
index 280fcecfe3157bf3a3eefaf6ef906387a95bde96..52a8db0000f258fe52f3d4238c5094279bfa5ad3 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-do compile }
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-add-options using-deprecated }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
index 2d4a7c3fb818ce31c7125bd2fb23e22f5804d9af..97085ffcc61013c245d2ac7d4f61535a3566decb 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -32,6 +33,6 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_unary_function<value_type, bool> 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);
-} 
+}
index f1daeedf6c75219f055d8383229d3500e122039c..2e019bc44f9f895e0a590959bf72e3fc28209c3b 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -31,6 +32,6 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_unary_function<value_type, bool> 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);
-} 
+}
index 2e6f90c289b392aca2837a49e8be3b0d79d623eb..2a110269253e10a109410f2be7dac4fe3b813ce3 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -32,6 +33,6 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
-  template iterator_type remove_if(iterator_type, iterator_type, 
+  template iterator_type remove_if(iterator_type, iterator_type,
                                   predicate_type);
-} 
+}
index 0dd817427d0a2e2023704ae6a33e329a9ecdd9bb..a1af922f395856db39b7382066bd58d903472763 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -31,6 +32,6 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
-  template iterator_type remove_if(iterator_type, iterator_type, 
+  template iterator_type remove_if(iterator_type, iterator_type,
                                   predicate_type);
-} 
+}
index 2c2036499817ee9040899c79c2a38d091cd6dc14..9f9ed215d437afc8caf8bf602a44eaf71bc290d2 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -32,7 +33,7 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_unary_function<value_type, bool> 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&);
-} 
+}
index c810aca3fded49c457c6a6b141454aaf87bf27de..7c2c86f38028d3455628619d07688acc285d30b4 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -31,7 +32,7 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_unary_function<value_type, bool> 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&);
-} 
+}
index 9e8b313b703864c31b0a6e6ec19a29ce3abb2ca7..54518a6bbc6c2f48974f2756ae73a274bb09cd49 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -34,4 +35,4 @@ namespace std
 
   template void replace_if(iterator_type, iterator_type, predicate_type,
                           const value_type&);
-} 
+}
index 184ab5a5691db8b9d7f941d56b54b47bb395bb15..513e35c814b5e505aa8c62efdc95beeccd0e3289 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -33,4 +34,4 @@ namespace std
 
   template void replace_if(iterator_type, iterator_type, predicate_type,
                           const value_type&);
-} 
+}
index fda04902c2ceae08b96877b3319b8df6070434e7..847e5caf4a20063c0db7d30a57934f4b5f6bfe96 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -32,9 +33,9 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_binary_function<value_type, value_type, bool> 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);
-} 
+}
index 5fcb5fc71bd68174a793ba83d017ac8fcbf3c96c..3890d2af610fb625bcaad1c52df0ae328dfe2768 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -31,9 +32,9 @@ namespace std
   typedef value_type*          iterator_type;
   typedef std::pointer_to_binary_function<value_type, value_type, bool> 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);
-} 
+}
index 1256ec6d943a8091082a47783580d54ac3061860..4668695f4546cdfad3629d5cbad2861ec0c1316b 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -33,9 +34,9 @@ namespace std
   typedef std::size_t          size_type;
   typedef std::pointer_to_binary_function<value_type, value_type, bool> 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);
-} 
+}
index 5bedc888481afe87ada7014ce9d0929ce7a6a62d..f32eba11e841356b91d849af7b78a22a5faeb7c7 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -32,9 +33,9 @@ namespace std
   typedef std::size_t          size_type;
   typedef std::pointer_to_binary_function<value_type, value_type, bool> 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);
-} 
+}
index e8d4ca6956b32a1571c820792e4c421a21c380d8..f2e4419f2fffd21d28d9d4da8f5992f0f70ae757 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -33,4 +34,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template iterator_type stable_partition(iterator_type, iterator_type, predicate_type);
-} 
+}
index 0982a73312173b72e267f2a4ebd6b0c193470416..e4e098001de6f9c97e21de77e8b212075b315f6f 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -32,4 +33,4 @@ namespace std
   typedef std::pointer_to_unary_function<value_type, bool> predicate_type;
 
   template iterator_type stable_partition(iterator_type, iterator_type, predicate_type);
-} 
+}
index 8c765cb1d029f6bd0de43706e03dc3900413a8dc..484d705568ea84fa3c3e5dfc887e1853287a4c73 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -37,4 +38,4 @@ namespace std
                                   operator1_type);
   template iterator_type transform(iterator_type, iterator_type, iterator_type,
                                   iterator_type, operator2_type);
-} 
+}
index dc563415c8e14acec4942a2d8287044154631f4f..59c9730a2f73d9846ad700339655ab97a91e60d8 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // 2007-09-20 Benjamin Kosnik <bkoz@redhat.com>
@@ -36,4 +37,4 @@ namespace std
                                   operator1_type);
   template iterator_type transform(iterator_type, iterator_type, iterator_type,
                                   iterator_type, operator2_type);
-} 
+}
index f81e2cd190ff5af6188c049e6f9519be732d8ee7..c4e7c5ed439e9331f934db5c23e95eb0f6332402 100644 (file)
@@ -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());
index fe239a269851999dd7fb0ed70afcd98fc52fc10b..7b7fd8f3d80a89da79bfcf65e7ac4e103427d676 100644 (file)
@@ -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<int>(), 500));
+  p.erase_if(bind1st(less<int>(), 500)); // { dg-warning "is deprecated" "" { target c++11 } }
 
   // The largest value should be now 500.
   assert(p.top() == 500);
index dcca7a306f33ead49f01defaf607324fed927a65..141359fd30b226e54f40946f043cfae955328351 100644 (file)
@@ -101,7 +101,7 @@ main()
     cout <<* it << endl;
 
   // Now split the queues.
-  even_p.split(bind2nd(modulus<int>(), 2), odd_p);
+  even_p.split(bind2nd(modulus<int>(), 2), odd_p); // { dg-warning "is deprecated" "" { target c++11 } }
 
   // Check that each one contains the appropriate 10 values.
 
index 3dd9ef5547ec0cd9f3cd2b8ea17e95356079421f..1653ad48094a7f045dfdc308758dfb5708fad0cc 100644 (file)
@@ -17,6 +17,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-options "-Wno-deprecated-declarations" }
+
 // 2.1 reference wrappers
 #include <tr1/functional>
 #include <tr1/type_traits>
index 5deb50d1dbaea24a8727377a232e4fd36bb33f8b..4fbdec95383a2ba4d12fe58b5fc36fc370c2f81d 100644 (file)
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated-declarations" }
 // { dg-do compile }
 
 // Copyright (C) 2007-2022 Free Software Foundation, Inc.
index 8205d81d7ba06493ed6d1cb6fd0b1c28ea7d1797..818957577be68d611696ff429a1351baf5382444 100644 (file)
@@ -48,12 +48,14 @@ namespace __gnu_pbds
     {
       template<typename T>
       struct regression_test_erase_if_fn
-      : public std::unary_function<T, bool>
       {
       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<typename Hd, class Tl>
       struct regression_test_erase_if_fn<std::pair<Hd, Tl> >
-      : public std::unary_function<std::pair<Hd, Tl>, bool>
       {
       private:
        typedef const std::pair<Hd, Tl>&  const_reference;
@@ -72,6 +73,9 @@ namespace __gnu_pbds
        typedef regression_test_erase_if_fn<Tl> tl_erase_if_fn;
 
       public:
+       typedef bool result_type;
+       typedef std::pair<Hd, Tl> argument_type;
+
        bool
         operator()(const_reference r_t) const
        {
index 556aca19af40d53624ebf105a821570fc66422d5..252f6e4542554f55098334a87a3574720e4851d3 100644 (file)
@@ -122,13 +122,18 @@ namespace __gnu_test
    */
   template<class T>
   struct output_iterator_wrapper
-  : public std::iterator<std::output_iterator_tag, void, std::ptrdiff_t, void, void>
   {
   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<T> ContainerType;
     T* ptr;
     ContainerType* SharedInfo;
@@ -209,8 +214,6 @@ namespace __gnu_test
    */
   template<class T>
   class input_iterator_wrapper
-  : public std::iterator<std::input_iterator_tag, typename remove_cv<T>::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<T>::type value_type;
+    typedef std::ptrdiff_t difference_type;
+    typedef T* pointer;
+    typedef T& reference;
+
     typedef BoundsContainer<T> ContainerType;
     T* ptr;
     ContainerType* SharedInfo;