[Bug c++/85958] Make const qualifier error clear

2020-05-06 Thread jg at jguk dot org
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]

[Bug c++/85958] Make const qualifier error clear

2020-05-06 Thread jg at jguk dot org
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=edit argument discards qualifiers Another example "argument discards qualifiers"

[Bug c++/85958] Make const qualifier error clear

2018-06-06 Thread jg at jguk dot org
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

[Bug c++/85958] Make const qualifier error clear

2018-06-04 Thread redi at gcc dot gnu.org
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

[Bug c++/85958] Make const qualifier error clear

2018-06-03 Thread webrown.cpp at gmail dot com
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

[Bug c++/85958] Make const qualifier error clear

2018-06-03 Thread redi at gcc dot gnu.org
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

[Bug c++/85958] Make const qualifier error clear

2018-06-01 Thread jg at jguk dot org
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:

[Bug c++/85958] Make const qualifier error clear

2018-06-01 Thread jg at jguk dot org
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)

[Bug c++/85958] Make const qualifier error clear

2018-05-30 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958 Tavian Barnes changed: What|Removed |Added CC||tavianator at gmail dot com --- Comment

[Bug c++/85958] Make const qualifier error clear

2018-05-30 Thread jg at jguk dot org
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

[Bug c++/85958] Make const qualifier error clear

2018-05-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85958 Jonathan Wakely changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug c++/85958] Make const qualifier error clear

2018-05-29 Thread jg at jguk dot org
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)