explicit
auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { }
- } _GLIBCXX_DEPRECATED;
+ } _GLIBCXX11_DEPRECATED;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
template<typename _Tp1>
operator auto_ptr<_Tp1>() throw()
{ return auto_ptr<_Tp1>(this->release()); }
- } _GLIBCXX_DEPRECATED;
+ } _GLIBCXX11_DEPRECATED_SUGGEST("std::unique_ptr");
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 541. shared_ptr template assignment and void
{
public:
typedef void element_type;
- } _GLIBCXX_DEPRECATED;
+ } _GLIBCXX11_DEPRECATED;
#if __cplusplus >= 201103L
template<_Lock_policy _Lp>
typename _Operation::result_type
operator()(typename _Operation::second_argument_type& __x) const
{ return op(value, __x); }
- } _GLIBCXX_DEPRECATED;
+ } _GLIBCXX11_DEPRECATED_SUGGEST("std::bind");
/// One of the @link binders binder functors@endlink.
template<typename _Operation, typename _Tp>
typename _Operation::result_type
operator()(typename _Operation::first_argument_type& __x) const
{ return op(__x, value); }
- } _GLIBCXX_DEPRECATED;
+ } _GLIBCXX11_DEPRECATED_SUGGEST("std::bind");
/// One of the @link binders binder functors@endlink.
template<typename _Operation, typename _Tp>
# define _GLIBCXX_USE_DEPRECATED 1
#endif
-#if defined(__DEPRECATED) && (__cplusplus >= 201103L)
+#if defined(__DEPRECATED)
# define _GLIBCXX_DEPRECATED __attribute__ ((__deprecated__))
+# define _GLIBCXX_DEPRECATED_SUGGEST(ALT) \
+ __attribute__ ((__deprecated__ ("use '" ALT "' instead")))
#else
# define _GLIBCXX_DEPRECATED
+# define _GLIBCXX_DEPRECATED_SUGGEST(ALT)
+#endif
+
+#if defined(__DEPRECATED) && (__cplusplus >= 201103L)
+# define _GLIBCXX11_DEPRECATED _GLIBCXX_DEPRECATED
+# define _GLIBCXX11_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
+#else
+# define _GLIBCXX11_DEPRECATED
+# define _GLIBCXX11_DEPRECATED_SUGGEST(ALT)
#endif
#if defined(__DEPRECATED) && (__cplusplus >= 201703L)
# define _GLIBCXX17_DEPRECATED [[__deprecated__]]
+# define _GLIBCXX17_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
#else
# define _GLIBCXX17_DEPRECATED
+# define _GLIBCXX17_DEPRECATED_SUGGEST(ALT)
#endif
#if defined(__DEPRECATED) && (__cplusplus > 201703L)
# define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]]
+# define _GLIBCXX20_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT)
#else
# define _GLIBCXX20_DEPRECATED(MSG)
+# define _GLIBCXX20_DEPRECATED_SUGGEST(ALT)
#endif
// Macros for ABI tag attributes.
#if __cplusplus <= 201402L
// Annex D.6 (removed in C++17)
- typedef int io_state;
- typedef int open_mode;
- typedef int seek_dir;
-
- typedef std::streampos streampos;
- typedef std::streamoff streamoff;
+ typedef int io_state
+ _GLIBCXX_DEPRECATED_SUGGEST("std::iostate");
+ typedef int open_mode
+ _GLIBCXX_DEPRECATED_SUGGEST("std::openmode");
+ typedef int seek_dir
+ _GLIBCXX_DEPRECATED_SUGGEST("std::seekdir");
+
+ typedef std::streampos streampos
+ _GLIBCXX_DEPRECATED_SUGGEST("std::streampos");
+ typedef std::streamoff streamoff
+ _GLIBCXX_DEPRECATED_SUGGEST("std::streamoff");
#endif
// Callbacks;
*
* See http://gcc.gnu.org/ml/libstdc++/2002-05/msg00168.html
*/
-#if __cplusplus >= 201103L
- [[__deprecated__("stossc is deprecated, use sbumpc instead")]]
-#endif
+ _GLIBCXX_DEPRECATED_SUGGEST("std::basic_streambuf::sbumpc")
void
stossc()
{
template<typename _Tp>
struct __is_nullptr_t
: public is_null_pointer<_Tp>
- { } _GLIBCXX_DEPRECATED;
+ { } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
// Composite type categories.
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+// { dg-options "-Wdeprecated" }
// { dg-do compile { target c++14_down } }
// 27.4.2.1 - Types [lib.ios.types]
// Annex D, deprecated.
void test01()
{
- typedef std::ios_base::streampos streampos_type;
- typedef std::ios_base::streamoff streamoff_type;
+ typedef std::ios_base::streampos streampos_type; // { dg-warning "is deprecated: use 'std::streampos' instead" }
+ typedef std::ios_base::streamoff streamoff_type; // { dg-warning "is deprecated: use 'std::streamoff' instead" }
+}
+
+// Annex D, deprecated.
+void test02()
+{
+ typedef std::ios_base::io_state iostate_type; // { dg-warning "is deprecated: use 'std::iostate' instead" }
+ typedef std::ios_base::open_mode openmode_type; // { dg-warning "is deprecated: use 'std::openmode' instead" }
+ typedef std::ios_base::seek_dir seekdir_type; // { dg-warning "is deprecated: use 'std::seekdir' instead" }
}