mirror of git://gcc.gnu.org/git/gcc.git
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:
parent
9af9532118
commit
5dce50b6a2
|
@ -140,6 +140,8 @@ test05()
|
||||||
{
|
{
|
||||||
reset_count_struct __attribute__((unused)) reset;
|
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)));
|
std::shared_ptr<A> a(std::move(std::shared_ptr<A>(new A)));
|
||||||
VERIFY( a.use_count() == 1 );
|
VERIFY( a.use_count() == 1 );
|
||||||
VERIFY( A::ctor_count == 1 );
|
VERIFY( A::ctor_count == 1 );
|
||||||
|
|
|
@ -106,6 +106,8 @@ test04()
|
||||||
{
|
{
|
||||||
reset_count_struct __attribute__((unused)) reset;
|
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
|
std::experimental::shared_ptr<A[5]> a(std::move(std::experimental
|
||||||
::shared_ptr<A[5]>
|
::shared_ptr<A[5]>
|
||||||
(new A[5])));
|
(new A[5])));
|
||||||
|
|
Loading…
Reference in New Issue