libstdc++: Suppress -Wpessimizing-move warnings in shared_ptr tests

libstdc++-v3/ChangeLog:

	* testsuite/20_util/shared_ptr/cons/move.cc: Add comment and
	dg-prune-output for -Wpessimizing-move warning.
	* testsuite/experimental/memory/shared_ptr/cons/move_ctor.cc:
	Likewise.
This commit is contained in:
Jonathan Wakely 2025-10-02 16:37:33 +01:00 committed by Jonathan Wakely
parent 9af9532118
commit 5dce50b6a2
No known key found for this signature in database
2 changed files with 4 additions and 0 deletions

View File

@ -140,6 +140,8 @@ test05()
{
reset_count_struct __attribute__((unused)) reset;
// The std::move here prevents copy elision, so we construct from a prvalue.
// { dg-prune-output "-Wpessimizing-move" }
std::shared_ptr<A> a(std::move(std::shared_ptr<A>(new A)));
VERIFY( a.use_count() == 1 );
VERIFY( A::ctor_count == 1 );

View File

@ -106,6 +106,8 @@ test04()
{
reset_count_struct __attribute__((unused)) reset;
// The std::move here prevents copy elision, so we construct from a prvalue.
// { dg-prune-output "-Wpessimizing-move" }
std::experimental::shared_ptr<A[5]> a(std::move(std::experimental
::shared_ptr<A[5]>
(new A[5])));