]> gcc.gnu.org Git - gcc.git/commitdiff
libstdc++: Fix -Wdeprecated-declarations warnings
authorJonathan Wakely <jwakely@redhat.com>
Thu, 10 Sep 2020 17:48:25 +0000 (18:48 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 29 Mar 2021 19:50:35 +0000 (20:50 +0100)
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.

(cherry picked from commit 0943b558171ffc731577c428d6c5f81897b6a034)

libstdc++-v3/include/experimental/bits/shared_ptr.h
libstdc++-v3/include/experimental/type_traits
libstdc++-v3/include/std/condition_variable

index 953f5b78a5f0d7735160d12d9fab6b337631ab7a..a32c1eef8956d6189ebe33393a87c428f8fa240d 100644 (file)
@@ -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>
index a92c385c0295761c4615509c4bf98a70b4984b52..11001bf184a40694a36f406b7244eec3e6f439ce 100644 (file)
@@ -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>
index 2db9dff6c31a442491f51da580b8e7aa8860fc51..a08cfc62705946f02a03f426656e30486c38ba63 100644 (file)
@@ -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;
This page took 0.05942 seconds and 5 git commands to generate.