https://gcc.gnu.org/g:89cb8a767dc507e10fe7b86a245109f0052aa9fa
commit r17-4903-g89cb8a767dc507e10fe7b86a245109f0052aa9fa Author: linden <[email protected]> Date: Sun Sep 6 15:58:46 2026 +1200 analyzer, diagnostics: add missing std::move for by-value sinks Three spots take an argument clearly meant to be sunk (by-value parameters, an rvalue-reference ctor param) but copy it instead of moving. Move in all three: infinite_loop's ctor, and add_labelled_value's 'id'/'label' parameters, matching the sibling 'value' parameter which was already moved. gcc/analyzer/ChangeLog: * infinite-loop.cc (infinite_loop::infinite_loop): std::move eedges into m_eedge_vec. gcc/ChangeLog: * diagnostics/html-sink.cc (add_labelled_value): std::move 'id' and 'label' into the xml::printer calls. Signed-off-by: linden <[email protected]> Diff: --- gcc/analyzer/infinite-loop.cc | 2 +- gcc/diagnostics/html-sink.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/analyzer/infinite-loop.cc b/gcc/analyzer/infinite-loop.cc index e1175cea624d..234f22819675 100644 --- a/gcc/analyzer/infinite-loop.cc +++ b/gcc/analyzer/infinite-loop.cc @@ -53,7 +53,7 @@ struct infinite_loop logger *logger) : m_enode (enode), m_loc (loc), - m_eedge_vec (eedges) + m_eedge_vec (std::move (eedges)) { LOG_SCOPE (logger); if (logger) diff --git a/gcc/diagnostics/html-sink.cc b/gcc/diagnostics/html-sink.cc index 185fc495f505..6a743a91ea6d 100644 --- a/gcc/diagnostics/html-sink.cc +++ b/gcc/diagnostics/html-sink.cc @@ -862,9 +862,9 @@ add_labelled_value (xml::printer &xp, bool quote_value) { xp.push_tag ("div", true); - xp.set_attr ("id", id); + xp.set_attr ("id", std::move (id)); xp.push_tag ("span"); - xp.add_text (label); + xp.add_text (std::move (label)); xp.add_text (" "); xp.pop_tag ("span"); xp.push_tag ("span");
