https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958

--- Comment #8 from W E Brown <webrown.cpp at gmail dot com> ---
C++ seems very clear that the semantics of parameter passage are those of
initialization.  For example, according to [expr.call]/7 in N4741:

"When a function is called, each parameter shall be initialized with its
corresponding argument" [cross-references omitted].

(1) We might therefore consider to rephrase the diagnostic so as to be
consistent with the Standard's nomenclature.  For example:

"can't initialize parameter of type 'int&' with argument of type 'const int'"

Or, flipping the phrasing:

"argument of type 'const int' can't initialize parameter of type 'int&'"

(I prefer the latter, actually, because the caret indicates the argument.
YMMV.)

(2) For the same reason, the note accompanying the diagnostic might at the same
time be more accurately rephrased as "initializing parameter 1 of ..." instead
of the current "initializing argument 1 of ...".

(3) Finally, there seems to be a fair amount of redundancy in the note,
mentioning the called function both with and without its parameter's name. 
Perhaps just one of these might suffice?

Just some thoughts for your consideration.

Reply via email to