From efbbd85f4ed58ffbd26c8dc4435bf053e9fc00a5 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 11 Jun 2019 13:13:15 -0700 Subject: [PATCH] yarlpl: Fix compilation with newer GCC Refcounted.h:45:23: error: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move] 45 | return std::move(old); --- yarpl/Refcounted.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarpl/Refcounted.h b/yarpl/Refcounted.h index e88886f16..ac0a4950d 100644 --- a/yarpl/Refcounted.h +++ b/yarpl/Refcounted.h @@ -42,7 +42,7 @@ std::shared_ptr atomic_exchange( auto refptr = ar->ref.lock(); auto old = std::move(*refptr); *refptr = std::move(r); - return std::move(old); + return old; } template