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

--- Comment #5 from Jonny Grant <jg at jguk dot org> ---
(In reply to Tavian Barnes from comment #4)
> IMHO "discards qualifiers" and even "discards const qualifier" are still
> confusing.  Making it clearly counterfactual, as in "...would discard
> (const) qualifier(s)...," would be an improvement.
> 
> But I'd further argue that "discarding qualifiers" is not really how most
> people think of this kind of error.  When a minor tries to get into a bar,
> they are not told that "entering this bar discards your age," they are told
> that "minors aren't allowed."  So I think "cannot bind 'const int' to
> non-const reference type 'int&'" would be more intuitive phrasing.

Hi Tavian

Yes, your proposal sounds good. Definitely clearer English would be very
helpful.

I personally feel "bind" is not a word any programming course teaches, we say
"passing parameters" or "passing arguments".

In addition, I feel we don't think we really need the word "reference"

Therefore, I suggest the following:

$ g++ -o main main.cpp -Wall -Werror -Wconversion
main.cpp: In function ‘int main()’:
main.cpp:11:25: error: cannot pass ‘const int’ to non-const ‘int&’

Reply via email to