From 084fb34971d733ce3f13e4902863539c95660ac7 Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Thu, 28 Sep 2023 07:04:06 -0500 Subject: [PATCH] osd: fix a missing 'noexcept' on a move ctor as a non-default, non-noexcept move ctor is ignored by stl containers. See clang-tidy's performance-noexcept-move-constructor Signed-off-by: Ronen Friedman --- src/osd/PG.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/osd/PG.h b/src/osd/PG.h index 2e82e74ab0127..5f071817d3d60 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1446,10 +1446,13 @@ public: */ class PGLockWrapper { public: - explicit PGLockWrapper(PGRef locked_pg) : m_pg{locked_pg} {} + template + explicit PGLockWrapper(A_PG_REF&& locked_pg) + : m_pg{std::forward(locked_pg)} + {} PGRef pg() { return m_pg; } ~PGLockWrapper(); - PGLockWrapper(PGLockWrapper&& rhs) : m_pg(std::move(rhs.m_pg)) { + PGLockWrapper(PGLockWrapper&& rhs) noexcept : m_pg(std::move(rhs.m_pg)) { rhs.m_pg = nullptr; } PGLockWrapper(const PGLockWrapper& rhs) = delete; -- 2.39.5