Skip to content

Commit

Permalink
Avoid compiler warning with gcc by not using move semantics
Browse files Browse the repository at this point in the history
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 <arne@openvpn.net>
  • Loading branch information
schwabe authored and ordex committed Jul 3, 2023
1 parent dabc3a0 commit b7bc687
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openvpn/common/enumdir.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b7bc687

Please sign in to comment.