Skip to main content

cpp_forwarding_call_argument

Function cpp_forwarding_call_argument 

Source
pub fn cpp_forwarding_call_argument<'tree>(
    call: Node<'tree>,
    source: &str,
) -> Option<Node<'tree>>
Expand description

The single argument a std::move or std::forward call forwards, or None for every other call.

As far as an overload’s parameter types are concerned these two are the identity: the argument’s type is the call’s type. Without that, Montgomery_Int(m_params, std::move(t)) had one argument of unknown type, the argument filter kept every candidate rather than guess, and the call reported ambiguous between the secure_vector<word> and std::span<const word> overloads (#2552).

Recognized structurally, from the callee’s scope and name fields: a qualified_identifier whose scope is std and whose name is move or forward, with the template arguments of std::forward<T>(t) unwrapped wherever the grammar attached them. A local move(x) or another namespace’s move is not this, and neither is a call with any argument count but one – that is not the standard signature, so the argument type stays unknown and the filter keeps every candidate.