// { 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;
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);
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);
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 );