From f559607d1ecf0b22a25d37f23b7c24f4c402306c Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 15 Oct 2024 19:04:58 -0700 Subject: [PATCH] mir: fix warnings with PerMachine move-constructor This is a legit issue, not only was the target being initialized first, but both the host and the target values were moving the target field from the other one. This last part is obviously really bad. --- src/mir/meson/machines.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mir/meson/machines.hpp b/src/mir/meson/machines.hpp index 7d41c96..fd71cf9 100644 --- a/src/mir/meson/machines.hpp +++ b/src/mir/meson/machines.hpp @@ -73,8 +73,7 @@ template class PerMachine { : _build{std::move(_b)}, _host{std::move(_h)}, _target{std::nullopt} {}; PerMachine(T && _b) : _build{std::move(_b)}, _host{std::nullopt}, _target{std::nullopt} {}; PerMachine(PerMachine && t) noexcept - : _build{std::move(t._build)}, _target{std::move(t._target)}, - _host{std::move(t._target)} {}; + : _build{std::move(t._build)}, _host{std::move(t._host)}, _target{std::move(t._target)} {}; ~PerMachine() = default; PerMachine & operator=(PerMachine && t) noexcept {