]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/experimental/memory/shared_ptr/modifiers/reset.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / experimental / memory / shared_ptr / modifiers / reset.cc
index 3f8f88ba1f5a74a90e5b481f258514c7051b2b10..159c87e285df31ee43ea0c70110107288313e0cb 100644 (file)
@@ -1,6 +1,6 @@
 // { dg-do run { target c++14 } }
 
-// Copyright (C) 2015-2016 Free Software Foundation, Inc.
+// Copyright (C) 2015-2024 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 #include <testsuite_hooks.h>
 
 struct A { };
-struct B : A { };
 struct D
 {
-  void operator()(B* p) { delete [] p; ++delete_count; }
+  void operator()(A* p) { delete [] p; ++delete_count; }
   static long delete_count;
 };
 long D::delete_count = 0;
@@ -37,8 +36,6 @@ long D::delete_count = 0;
 int
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   A * const a = new A[5];
   std::experimental::shared_ptr<A[5]> p1(a);
   std::experimental::shared_ptr<A[5]> p2(p1);
@@ -52,10 +49,8 @@ test01()
 int
 test02()
 {
-  bool test __attribute__((unused)) = true;
-
   A * const a = new A[5];
-  B * const b = new B[5];
+  A * const b = new A[5];
   std::experimental::shared_ptr<A[5]> p1(a);
   std::experimental::shared_ptr<A[5]> p2(p1);
   p1.reset(b);
@@ -68,11 +63,9 @@ test02()
 int
 test03()
 {
-  bool test __attribute__((unused)) = true;
-
   {
     std::experimental::shared_ptr<A[5]> p1;
-    p1.reset(new B[5], D());
+    p1.reset(new A[5], D());
   }
   VERIFY( D::delete_count == 1 );