https://gcc.gnu.org/g:d5cdcaaf9a8800900f60dd7f8894f12cbcab11d3
commit r17-4905-gd5cdcaaf9a8800900f60dd7f8894f12cbcab11d3 Author: linden <[email protected]> Date: Sat Sep 26 18:41:52 2026 +1200 gcc, analyzer: drop std::move calls that have no effect Three call sites wrap an argument in std::move where no move can actually happen: the callee only takes a const reference, or there is no std::string::operator+=(std::string&&). Remove the std::move in each; behaviour is unchanged. gcc/ChangeLog: * xml.cc (node_with_children::add_text): Remove no-op std::move. gcc/analyzer/ChangeLog: * access-diagram.cc (access_diagram_impl::make_warning_string): Remove no-op std::move. * engine.cc (exploded_graph::unwind_from_exception): Likewise. Signed-off-by: linden <[email protected]> Diff: --- gcc/analyzer/access-diagram.cc | 2 +- gcc/analyzer/engine.cc | 2 +- gcc/xml.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/analyzer/access-diagram.cc b/gcc/analyzer/access-diagram.cc index 9caafcdb55d0..861823f6aea6 100644 --- a/gcc/analyzer/access-diagram.cc +++ b/gcc/analyzer/access-diagram.cc @@ -2347,7 +2347,7 @@ private: overlapping the next char. Hence we add two spaces here: a space to be covered by this overlap, plus another space of padding. */ result.append (styled_string (m_sm, " ")); - result.append (std::move (text)); + result.append (text); return result; } diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index 830164dac778..c8a7dcef730e 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -1498,7 +1498,7 @@ exploded_graph::unwind_from_exception (exploded_node &thrown_enode, exploded_node *after_unwind_enode = get_or_create_node (unwound_point, - std::move (unwound_state), + unwound_state, iter_enode, /* Don't add this enode to the worklist; we will process it diff --git a/gcc/xml.cc b/gcc/xml.cc index ad6b8460b6f7..4659b69afe4d 100644 --- a/gcc/xml.cc +++ b/gcc/xml.cc @@ -116,7 +116,7 @@ node_with_children::add_text (std::string str) if (!m_children.empty ()) if (text *t = m_children.back ()->dyn_cast_text ()) { - t->m_str += std::move (str); + t->m_str += str; return; } add_child (std::make_unique <text> (std::move (str)));
