From b7bc68739669ceb9f3f8e93903240976c6d79864 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 25 Apr 2023 20:47:27 +0200 Subject: [PATCH] Avoid compiler warning with gcc by not using move semantics gcc 12+ warn about temporary that used after its lifetime when we use the move semantics here. Since the code here is not super performance critical just remove the move semantics to be able to compile with Werror. Signed-off-by: Arne Schwabe --- openvpn/common/enumdir.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvpn/common/enumdir.hpp b/openvpn/common/enumdir.hpp index 93913ef2a..120ee4a43 100644 --- a/openvpn/common/enumdir.hpp +++ b/openvpn/common/enumdir.hpp @@ -52,7 +52,7 @@ inline bool enum_dir(const std::string &dirname, { std::string fn(e->d_name); if (fn != "." && fn != "..") - func(std::move(fn)); + std::invoke(func, fn); } return true; }