[Bug c++/88320] GCC suggests variables that don't exist yet

2018-12-05 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88320 David Malcolm changed: What|Removed |Added Keywords||patch URL|

[Bug c++/88320] GCC suggests variables that don't exist yet

2018-12-05 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88320 --- Comment #9 from Jonny Grant --- (In reply to David Malcolm from comment #8) > FWIW, clang trunk currently gives the same erroneous suggestion: > > :4:19: error: use of undeclared identifier 'aresults'; did you mean > 'aresult'? > int are

[Bug c++/88320] GCC suggests variables that don't exist yet

2018-12-05 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88320 --- Comment #8 from David Malcolm --- FWIW, clang trunk currently gives the same erroneous suggestion: :4:19: error: use of undeclared identifier 'aresults'; did you mean 'aresult'? int aresult = aresults +1; ^~~~

[Bug c++/88320] GCC suggests variables that don't exist yet

2018-12-05 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88320 David Malcolm changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|

[Bug c++/88320] GCC suggests variables that don't exist yet

2018-12-04 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88320 --- Comment #6 from David Malcolm --- I did a little investigation of this. A tweaked reproducer, for both C and C++: int test (void) { int vresults1 = 0; int aresult = aresults +1; return aresult; } I think that we should omit an

[Bug c++/88320] GCC suggests variables that don't exist yet

2018-12-03 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88320 Martin Sebor changed: What|Removed |Added Keywords||diagnostic CC|

[Bug c++/88320] GCC suggests variables that don't exist yet

2018-12-03 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88320 --- Comment #4 from Jonny Grant --- (In reply to Jonathan Wakely from comment #3) > (In reply to Jonny Grant from comment #0) > > Suggestion on line 5 of a variable which is acutally the return value, and > > doesn't exist yet. Better to only sug

[Bug c++/88320] GCC suggests variables that don't exist yet

2018-12-03 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88320 --- Comment #3 from Jonathan Wakely --- (In reply to Jonny Grant from comment #0) > Suggestion on line 5 of a variable which is acutally the return value, and > doesn't exist yet. Better to only suggest alternative as variables that > exist alrea

[Bug c++/88320] GCC suggests variables that don't exist yet

2018-12-03 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88320 --- Comment #2 from Jonathan Wakely --- (In reply to Jonny Grant from comment #1) > Created attachment 45144 [details] > test case Reproduced here, as it's tiny and more convenient in a comment than as an attachment: // g++ -Wall -O2 -o suggest

[Bug c++/88320] GCC suggests variables that don't exist yet

2018-12-03 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88320 --- Comment #1 from Jonny Grant --- Created attachment 45144 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45144&action=edit test case