C: don't suggest names that came from earlier failures (PR c/83056)
commitb8a6d52be517ed5915e06946a9a4e87dd9bd64a6
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Nov 2017 21:59:53 +0000 (21 21:59 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Nov 2017 21:59:53 +0000 (21 21:59 +0000)
tree376083f6cff4bc91793837fc6b29d03e9e4916c5
parent9ec8f524b89845eee94286cf082a55270c3d51b6
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255038 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/spellcheck-pr83056.c [new file with mode: 0644]