From 3e2f4bd94969a4356c6ab55899db4de860a07d81 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 5 Feb 2026 12:09:36 +0100 Subject: [PATCH] dnsdist: Add missing `noexcept` on move ctors/assignment operators Signed-off-by: Remi Gacogne --- pdns/dnsdistdist/dnsdist-nghttp2.cc | 15 +++------------ pdns/dnsdistdist/dnsdist-tcp.hh | 4 ++-- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/pdns/dnsdistdist/dnsdist-nghttp2.cc b/pdns/dnsdistdist/dnsdist-nghttp2.cc index be53ce1970..5fde5345b7 100644 --- a/pdns/dnsdistdist/dnsdist-nghttp2.cc +++ b/pdns/dnsdistdist/dnsdist-nghttp2.cc @@ -978,22 +978,13 @@ struct DoHClientCollection::DoHWorkerThread { } - DoHWorkerThread(pdns::channel::Sender&& sender) : + DoHWorkerThread(pdns::channel::Sender&& sender) noexcept : d_sender(std::move(sender)) { } - DoHWorkerThread(DoHWorkerThread&& rhs) : - d_sender(std::move(rhs.d_sender)) - { - } - - DoHWorkerThread& operator=(DoHWorkerThread&& rhs) - { - d_sender = std::move(rhs.d_sender); - return *this; - } - + DoHWorkerThread(DoHWorkerThread&& rhs) noexcept = default; + DoHWorkerThread& operator=(DoHWorkerThread&& rhs) noexcept = default; DoHWorkerThread(const DoHWorkerThread& rhs) = delete; DoHWorkerThread& operator=(const DoHWorkerThread&) = delete; diff --git a/pdns/dnsdistdist/dnsdist-tcp.hh b/pdns/dnsdistdist/dnsdist-tcp.hh index 806d484ab5..aaa9339955 100644 --- a/pdns/dnsdistdist/dnsdist-tcp.hh +++ b/pdns/dnsdistdist/dnsdist-tcp.hh @@ -38,7 +38,7 @@ struct ConnectionInfo remote(remote_), cs(cs_), fd(-1) { } - ConnectionInfo(ConnectionInfo&& rhs) : + ConnectionInfo(ConnectionInfo&& rhs) noexcept : remote(rhs.remote), cs(rhs.cs), fd(rhs.fd), d_restricted(rhs.d_restricted) { rhs.cs = nullptr; @@ -48,7 +48,7 @@ struct ConnectionInfo ConnectionInfo(const ConnectionInfo& rhs) = delete; ConnectionInfo& operator=(const ConnectionInfo& rhs) = delete; - ConnectionInfo& operator=(ConnectionInfo&& rhs) + ConnectionInfo& operator=(ConnectionInfo&& rhs) noexcept { remote = rhs.remote; cs = rhs.cs; -- 2.47.3