https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
--- Comment #12 from Jonny Grant ---
Another example const.cpp attached.
The message doesn't mention it's the const qualifier.
Expected:
:6:21: error: passing 'const
std::vector >' as 'this' argument discards
const qualifier [-fpermissive]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
--- Comment #11 from Jonny Grant ---
Created attachment 48463
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48463&action=edit
argument discards qualifiers
Another example "argument discards qualifiers"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
--- Comment #10 from Jonny Grant ---
(In reply to Jonathan Wakely from comment #7)
> (In reply to Jonny Grant from comment #5)
> > I personally feel "bind" is not a word any programming course teaches, we
> > say "passing parameters" or "passing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
--- Comment #9 from Jonathan Wakely ---
(In reply to W E Brown from comment #8)
> (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 o
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
--- Comment #8 from W E Brown ---
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 i
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
--- Comment #7 from Jonathan Wakely ---
(In reply to Jonny Grant from comment #5)
> I personally feel "bind" is not a word any programming course teaches, we
> say "passing parameters" or "passing arguments".
You pass arguments, which initialize
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
--- Comment #6 from Jonny Grant ---
Clang shows:
$ clang -o main main.cpp -Wall -Werror -Wconversion
main.cpp:15:5: error: no matching function for call to 'strstripspace'
strstripspace(unused, two);
^
main.cpp:5:6: note: can
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
--- Comment #5 from Jonny Grant ---
(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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
Tavian Barnes changed:
What|Removed |Added
CC||tavianator at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
--- Comment #3 from Jonny Grant ---
(In reply to Jonathan Wakely from comment #2)
> (In reply to Jonny Grant from comment #1)
> > My idea of what would be clearest is :-
> >
> > Cannot pass ‘const int‘ as ‘int&‘ (non const)
>
> I don't think th
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
Jonathan Wakely changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958
--- Comment #1 from Jonny Grant ---
My idea of what would be clearest is :-
Cannot pass ‘const int‘ as ‘int&‘ (non const)
12 matches
Mail list logo