public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r11-3122] libstdc++: Fix -Wdeprecated-declarations warnings
Date: Thu, 10 Sep 2020 18:16:49 +0000 (GMT)	[thread overview]
Message-ID: <20200910181649.59BDC3972437@sourceware.org> (raw)

https://gcc.gnu.org/g:0943b558171ffc731577c428d6c5f81897b6a034

commit r11-3122-g0943b558171ffc731577c428d6c5f81897b6a034
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 10 18:48:25 2020 +0100

    libstdc++: Fix -Wdeprecated-declarations warnings
    
    libstdc++-v3/ChangeLog:
    
            * include/experimental/bits/shared_ptr.h (shared_ptr(auto_ptr&&))
            (operator=(auto_ptr&&)): Add diagnostic pragmas to suppress
            warnings for uses of std::auto_ptr.
            * include/experimental/type_traits (is_literal_type_v):
            Likewise, for use of std::is_literal_type.
            * include/std/condition_variable (condition_variable_any::_Unlock):
            Likewise, for use of std::uncaught_exception.

Diff:
---
 libstdc++-v3/include/experimental/bits/shared_ptr.h | 6 ++++++
 libstdc++-v3/include/experimental/type_traits       | 2 +-
 libstdc++-v3/include/std/condition_variable         | 3 +++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/experimental/bits/shared_ptr.h b/libstdc++-v3/include/experimental/bits/shared_ptr.h
index 953f5b78a5f..a32c1eef895 100644
--- a/libstdc++-v3/include/experimental/bits/shared_ptr.h
+++ b/libstdc++-v3/include/experimental/bits/shared_ptr.h
@@ -137,10 +137,13 @@ inline namespace fundamentals_v2
 	: _Base_type(__r) { }
 
 #if _GLIBCXX_USE_DEPRECATED
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
       template<typename _Tp1, typename = _Compatible<_Tp1>>
 	shared_ptr(std::auto_ptr<_Tp1>&& __r)
 	: _Base_type(std::move(__r))
 	{ _M_enable_shared_from_this_with(static_cast<_Tp1*>(this->get())); }
+#pragma GCC diagnostic pop
 #endif
 
       template<typename _Tp1, typename _Del,
@@ -187,6 +190,8 @@ inline namespace fundamentals_v2
 	}
 
 #if _GLIBCXX_USE_DEPRECATED
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
       template<typename _Tp1>
 	_Compatible<_Tp1, shared_ptr&>
 	operator=(std::auto_ptr<_Tp1>&& __r)
@@ -194,6 +199,7 @@ inline namespace fundamentals_v2
 	  __shared_ptr<_Tp>::operator=(std::move(__r));
 	  return *this;
 	}
+#pragma GCC diagnostic pop
 #endif
 
       template <typename _Tp1, typename _Del>
diff --git a/libstdc++-v3/include/experimental/type_traits b/libstdc++-v3/include/experimental/type_traits
index a92c385c029..11001bf184a 100644
--- a/libstdc++-v3/include/experimental/type_traits
+++ b/libstdc++-v3/include/experimental/type_traits
@@ -114,9 +114,9 @@ template <typename _Tp>
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 template <typename _Tp>
   constexpr bool is_pod_v = is_pod<_Tp>::value;
-#pragma GCC diagnostic pop
 template <typename _Tp>
   constexpr bool is_literal_type_v = is_literal_type<_Tp>::value;
+#pragma GCC diagnostic pop
 template <typename _Tp>
   constexpr bool is_empty_v = is_empty<_Tp>::value;
 template <typename _Tp>
diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable
index 2db9dff6c31..a08cfc62705 100644
--- a/libstdc++-v3/include/std/condition_variable
+++ b/libstdc++-v3/include/std/condition_variable
@@ -266,6 +266,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
 	explicit _Unlock(_Lock& __lk) : _M_lock(__lk) { __lk.unlock(); }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 	~_Unlock() noexcept(false)
 	{
 	  if (uncaught_exception())
@@ -280,6 +282,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	  else
 	    _M_lock.lock();
 	}
+#pragma GCC diagnostic pop
 
 	_Unlock(const _Unlock&) = delete;
 	_Unlock& operator=(const _Unlock&) = delete;


                 reply	other threads:[~2020-09-10 18:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200910181649.59BDC3972437@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).