[Bug c/83056] GCC suggests the use of previously reported undeclared identifiers when reporting new undeclared identifiers

2017-11-21 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83056

--- Comment #4 from David Malcolm  ---
Fixed on trunk for gcc 8 by r255038; not yet fixed on gcc-7-branch.

[Bug c/83056] GCC suggests the use of previously reported undeclared identifiers when reporting new undeclared identifiers

2017-11-21 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83056

--- Comment #3 from David Malcolm  ---
Author: dmalcolm
Date: Tue Nov 21 21:59:53 2017
New Revision: 255038

URL: https://gcc.gnu.org/viewcvs?rev=255038=gcc=rev
Log:
C: don't suggest names that came from earlier failures (PR c/83056)

PR c/83056 reports an issue affecting trunk and gcc-7 in which
the C frontend's implementation of lookup_name_fuzzy uses undeclared
identifiers as suggestions when encountering subsequent undeclared
identifiers.

The fix is to filter out the names bound to error_mark_node
in lookup_name_fuzzy.

The C++ frontend is unaffected, as it already does this.

gcc/c/ChangeLog:
PR c/83056
* c-decl.c (lookup_name_fuzzy): Don't suggest names that came from
earlier failed lookups.

gcc/testsuite/ChangeLog:
PR c/83056
* gcc.dg/spellcheck-pr83056.c: New test case.


Added:
trunk/gcc/testsuite/gcc.dg/spellcheck-pr83056.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-decl.c
trunk/gcc/testsuite/ChangeLog

[Bug c/83056] GCC suggests the use of previously reported undeclared identifiers when reporting new undeclared identifiers

2017-11-21 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83056

--- Comment #2 from David Malcolm  ---
Candidate patch:
  https://gcc.gnu.org/ml/gcc-patches/2017-11/msg01907.html

[Bug c/83056] GCC suggests the use of previously reported undeclared identifiers when reporting new undeclared identifiers

2017-11-20 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83056

David Malcolm  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |dmalcolm at gcc dot 
gnu.org

[Bug c/83056] GCC suggests the use of previously reported undeclared identifiers when reporting new undeclared identifiers

2017-11-20 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83056

David Malcolm  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-11-20
 Ever confirmed|0   |1

--- Comment #1 from David Malcolm  ---
Thanks for filing this.

Confirmed: this still affects trunk, with the C frontend (the "-O3 -Wall"
aren't needed).  The C++ frontend doesn't seem to be affected.