Skip to content

Commit 084fb34

Browse files
committed
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 <[email protected]>
1 parent 171d2b5 commit 084fb34

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/osd/PG.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,10 +1446,13 @@ class PG : public DoutPrefixProvider,
14461446
*/
14471447
class PGLockWrapper {
14481448
public:
1449-
explicit PGLockWrapper(PGRef locked_pg) : m_pg{locked_pg} {}
1449+
template <typename A_PG_REF>
1450+
explicit PGLockWrapper(A_PG_REF&& locked_pg)
1451+
: m_pg{std::forward<A_PG_REF>(locked_pg)}
1452+
{}
14501453
PGRef pg() { return m_pg; }
14511454
~PGLockWrapper();
1452-
PGLockWrapper(PGLockWrapper&& rhs) : m_pg(std::move(rhs.m_pg)) {
1455+
PGLockWrapper(PGLockWrapper&& rhs) noexcept : m_pg(std::move(rhs.m_pg)) {
14531456
rhs.m_pg = nullptr;
14541457
}
14551458
PGLockWrapper(const PGLockWrapper& rhs) = delete;

0 commit comments

Comments
 (0)