public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-3655] libstdc++: Enable std::auto_ptr tests for C++11 and later
@ 2023-09-04 16:29 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-09-04 16:29 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:678834e9ff541f4a5b1065357e94e863b6f34913

commit r14-3655-g678834e9ff541f4a5b1065357e94e863b6f34913
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Sep 4 14:25:14 2023 +0100

    libstdc++: Enable std::auto_ptr tests for C++11 and later
    
    There is no reason to only test std::auto_ptr with -std=c++03, we just
    need to handle the deprecated warnings for C++11 and later.
    
    libstdc++-v3/ChangeLog:
    
            * testsuite/20_util/auto_ptr/1.cc: Remove dg-options -std=c++03
            and add dg-warning for deprecation warnings.
            * testsuite/20_util/auto_ptr/2.cc: Likewise.
            * testsuite/20_util/auto_ptr/3.cc: Likewise.
            * testsuite/20_util/auto_ptr/3946.cc: Likewise.
            * testsuite/20_util/auto_ptr/4.cc: Likewise.
            * testsuite/20_util/auto_ptr/5.cc: Likewise.
            * testsuite/20_util/auto_ptr/6.cc: Likewise.
            * testsuite/20_util/auto_ptr/7.cc: Likewise.
            * testsuite/20_util/auto_ptr/assign_neg.cc: Likewise.
            * testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc:
            Likewise.
            * testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc:
            Likewise.
            * testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc:
            Likewise.
            * testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc:
            Likewise.
            * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc:
            Likewise.
            * testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc:
            Likewise.
            * testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc:
            Likewise.

Diff:
---
 libstdc++-v3/testsuite/20_util/auto_ptr/1.cc                   | 10 +++++-----
 libstdc++-v3/testsuite/20_util/auto_ptr/2.cc                   |  5 +++--
 libstdc++-v3/testsuite/20_util/auto_ptr/3.cc                   |  5 +++--
 libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc                |  5 +++--
 libstdc++-v3/testsuite/20_util/auto_ptr/4.cc                   |  5 +++--
 libstdc++-v3/testsuite/20_util/auto_ptr/5.cc                   |  5 +++--
 libstdc++-v3/testsuite/20_util/auto_ptr/6.cc                   |  5 +++--
 libstdc++-v3/testsuite/20_util/auto_ptr/7.cc                   |  5 +++--
 libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc          |  6 +++---
 .../20_util/auto_ptr/requirements/explicit_instantiation/1.cc  |  6 +++---
 .../tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc      |  3 ++-
 .../tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc  |  3 ++-
 .../shared_ptr/assign/auto_ptr_rvalue_neg.cc                   |  3 ++-
 .../tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc       |  3 ++-
 .../tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc        |  3 ++-
 .../tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc    |  3 ++-
 16 files changed, 44 insertions(+), 31 deletions(-)

diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/1.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/1.cc
index b498711da765..64c0cf97e2ff 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/1.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/1.cc
@@ -15,9 +15,9 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
 
 #include <memory>
 #include <testsuite_hooks.h>
@@ -63,21 +63,21 @@ test01()
 {
   reset_count_struct __attribute__((unused)) reset;
 
-  std::auto_ptr<A> A_default;
+  std::auto_ptr<A> A_default; // { dg-warning "deprecated" "" { target c++11 } }
   VERIFY( A_default.get() == 0 );
   VERIFY( A::ctor_count == 0 );
   VERIFY( A::dtor_count == 0 );
   VERIFY( B::ctor_count == 0 );
   VERIFY( B::dtor_count == 0 );
 
-  std::auto_ptr<A> A_from_A(new A);
+  std::auto_ptr<A> A_from_A(new A); // { dg-warning "deprecated" "" { target c++11 } }
   VERIFY( A_from_A.get() != 0 );
   VERIFY( A::ctor_count == 1 );
   VERIFY( A::dtor_count == 0 );
   VERIFY( B::ctor_count == 0 );
   VERIFY( B::dtor_count == 0 );
 
-  std::auto_ptr<A> A_from_B(new B);
+  std::auto_ptr<A> A_from_B(new B); // { dg-warning "deprecated" "" { target c++11 } }
   VERIFY( A_from_B.get() != 0 );
   VERIFY( A::ctor_count == 2 );
   VERIFY( A::dtor_count == 0 );
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/2.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/2.cc
index 0d5aabe61a42..9cbab139068b 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/2.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/2.cc
@@ -15,9 +15,10 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 #include <memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/3.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/3.cc
index afac4013b59d..ce020406cb8b 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/3.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/3.cc
@@ -15,9 +15,10 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 #include <memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc
index d6d755ac9113..42ccf99c1812 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/3946.cc
@@ -15,9 +15,10 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 #include <memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/4.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/4.cc
index fb896e11f024..7cf59965d7aa 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/4.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/4.cc
@@ -15,9 +15,10 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 #include <memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/5.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/5.cc
index 8a766e6ec239..1e60f13a20d9 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/5.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/5.cc
@@ -15,9 +15,10 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 #include <memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc
index cd1f0547f5b2..d888301c7668 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/6.cc
@@ -15,9 +15,10 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 #include <memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/7.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/7.cc
index 86338c7e2590..fd3f78a46cda 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/7.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/7.cc
@@ -15,9 +15,10 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 20.4.5 Template class auto_ptr [lib.auto.ptr]
+// C++03 20.4.5 Template class auto_ptr [lib.auto.ptr]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 #include <memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc
index 5ff2ddb9113d..fa890fa4fcd8 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/assign_neg.cc
@@ -1,4 +1,6 @@
 // { dg-do compile }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 // Copyright (C) 2002-2023 Free Software Foundation, Inc.
 //
@@ -17,9 +19,7 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 20.4.5 Template class auto_ptr negative tests [lib.auto.ptr]
-
-// { dg-options "-std=c++98" }
+// C++03 20.4.5 Template class auto_ptr negative tests [lib.auto.ptr]
 
 #include <memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc
index be7fb4822505..b26b784fd4ff 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc
@@ -1,4 +1,6 @@
 // { dg-do compile }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 // Copyright (C) 2007-2023 Free Software Foundation, Inc.
 //
@@ -18,9 +20,7 @@
 // <http://www.gnu.org/licenses/>.
 
 
-// This file tests explicit instantiation of library containers.
-
-// { dg-options "-std=c++98" }
+// This file tests explicit instantiation of library templates.
 
 #include <memory>
 
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc
index c3ac4af7b7f3..ad39e18eeeee 100644
--- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc
@@ -17,7 +17,8 @@
 
 // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 #include <tr1/memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc
index 56cc149fd685..2f8697a3fa2d 100644
--- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc
@@ -19,7 +19,8 @@
 
 // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 #include <tr1/memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc
index b77208a620ee..2efc9dee8239 100644
--- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc
@@ -19,7 +19,8 @@
 
 // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 #include <tr1/memory>
 #include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc
index f6ba60aa824f..3229a52c6369 100644
--- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc
@@ -17,7 +17,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-options "-std=c++98 -fno-show-column" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 // 2.2.3 Class template shared_ptr [tr.util.smartptr.shared]
 
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc
index 371b2a8c96ef..d885597798aa 100644
--- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc
@@ -15,7 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]
 
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc
index 88c896cc17f8..8b2fff2e387b 100644
--- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc
@@ -17,7 +17,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-options "-std=c++98" }
+// { dg-add-options using-deprecated }
+// { dg-warning "auto_ptr. is deprecated" "" { target c++11 } 0 }
 
 // TR1 2.2.2 Template class shared_ptr [tr.util.smartptr.shared]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-04 16:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-04 16:29 [gcc r14-3655] libstdc++: Enable std::auto_ptr tests for C++11 and later Jonathan Wakely

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).