]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Disable -Wctor-dtor-privacy warnings for some standard types
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Jun 2019 14:03:20 +0000 (14:03 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Jun 2019 14:03:20 +0000 (14:03 +0000)
* include/experimental/type_traits (experimental::nonesuch): Use
pragma to disable -Wctor-dtor-privacy warnings.
* include/std/type_traits (__is_convertible_helper<From, To, false>)
(__is_nt_convertible_helper<From, To, false>, __nonesuch): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272289 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/type_traits
libstdc++-v3/include/std/type_traits

index 1c63033b96b38353b550f9d06e4cb85e5cd00c7a..9eb70fcf8b6b12f76a79ee05fbb4f07b872a8d1b 100644 (file)
@@ -1,5 +1,10 @@
 2019-06-14  Jonathan Wakely  <jwakely@redhat.com>
 
+       * include/experimental/type_traits (experimental::nonesuch): Use
+       pragma to disable -Wctor-dtor-privacy warnings.
+       * include/std/type_traits (__is_convertible_helper<From, To, false>)
+       (__is_nt_convertible_helper<From, To, false>, __nonesuch): Likewise.
+
        * include/std/version (__cpp_lib_bind_front): Add missing macro.
 
 2019-06-12  Jonathan Wakely  <jwakely@redhat.com>
index 2403bd242233a8402083ba93f76f5daabf77787e..464c8d2f4bf5a1e414ecf570803644cdf458ce08 100644 (file)
@@ -227,6 +227,8 @@ inline namespace fundamentals_v2
 
 template<typename...> using void_t = void;
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
 struct __nonesuchbase {};
 struct nonesuch : private __nonesuchbase
 {
@@ -234,6 +236,7 @@ struct nonesuch : private __nonesuchbase
   nonesuch(nonesuch const&) = delete;
   void operator=(nonesuch const&) = delete;
 };
+#pragma GCC diagnostic pop
 
 template<template<typename...> class _Op, typename... _Args>
   using is_detected
index e53d3c8d53543ab0762e5f83ad3af3720ea66655..7d4deb156a1616acfa51388d9cd62a967abe4d2f 100644 (file)
@@ -1448,6 +1448,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       typedef typename is_void<_To>::type type;
     };
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
   template<typename _From, typename _To>
     class __is_convertible_helper<_From, _To, false>
     {
@@ -1466,7 +1468,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     public:
       typedef decltype(__test<_From, _To>(0)) type;
     };
-
+#pragma GCC diagnostic pop
 
   /// is_convertible
   template<typename _From, typename _To>
@@ -1481,6 +1483,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     : is_void<_To>
     { };
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
   template<typename _From, typename _To>
     class __is_nt_convertible_helper<_From, _To, false>
     {
@@ -1499,6 +1503,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     public:
       using type = decltype(__test<_From, _To>(0));
     };
+#pragma GCC diagnostic pop
 
   // is_nothrow_convertible for C++11
   template<typename _From, typename _To>
@@ -2894,12 +2899,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
              __call_is_nothrow_<_Fn, _Args...>>::type
     { };
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
   struct __nonesuchbase {};
   struct __nonesuch : private __nonesuchbase {
     ~__nonesuch() = delete;
     __nonesuch(__nonesuch const&) = delete;
     void operator=(__nonesuch const&) = delete;
   };
+#pragma GCC diagnostic pop
 
 #if __cplusplus >= 201703L
 # define __cpp_lib_is_invocable 201703