From c252f40b6ff20ce8526878c9c79a08f36279a5f2 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Thu, 20 Mar 2025 20:57:06 -0500 Subject: [PATCH] App: Don't use std::forward inside loop std::forward implies that sometimes its argument will be *moved*, leaving it invalid in the calling code. If that call is inside a loop that tries to reuse the data we have undefined behavior. --- src/App/PropertyLinks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App/PropertyLinks.cpp b/src/App/PropertyLinks.cpp index fdcfd5517f..75b9d6464b 100644 --- a/src/App/PropertyLinks.cpp +++ b/src/App/PropertyLinks.cpp @@ -1955,7 +1955,7 @@ std::vector updateLinkSubs(const App::DocumentObject* obj, std::vector res; for (auto it = subs.begin(); it != subs.end(); ++it) { const auto& sub = *it; - auto new_sub = (*f)(obj, sub.c_str(), std::forward(args)...); + auto new_sub = (*f)(obj, sub.c_str(), args...); if (new_sub.size()) { if (res.empty()) { res.reserve(subs.size());