spellcheck bugfixes: don't offer the goal string as a suggestion
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 29 Nov 2016 16:25:01 +0000 (16:25 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 29 Nov 2016 16:25:01 +0000 (16:25 +0000)
commit8bf3cdff10beadb7072b0841be3fc7381d3218bd
tree006b95a47c80c65017ae64cf4c8fceb7ae9e9f9f
parent8684b292035b9463cdd12cc6f0a5114b775cfadb
spellcheck bugfixes: don't offer the goal string as a suggestion

gcc/cp/ChangeLog:
PR c++/77922
* name-lookup.c (lookup_name_fuzzy): Filter out reserved words
that were filtered out by init_reswords.

gcc/ChangeLog:
PR c++/72774
PR c++/72786
PR c++/77922
PR c++/78313
* spellcheck.c (selftest::test_find_closest_string): Verify that
we don't offer the goal string as a suggestion.
* spellcheck.h (best_match::get_best_meaningful_candidate): Don't
offer the goal string as a suggestion.

gcc/testsuite/ChangeLog:
PR c++/72774
PR c++/72786
PR c++/77922
PR c++/78313
* g++.dg/spellcheck-c++-11-keyword.C: New test case.
* g++.dg/spellcheck-macro-ordering.C: New test case.
* g++.dg/spellcheck-pr78313.C: New test case.

From-SVN: r242965
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/spellcheck.c
gcc/spellcheck.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/spellcheck-c++-11-keyword.C [new file with mode: 0644]
gcc/testsuite/g++.dg/spellcheck-macro-ordering.C [new file with mode: 0644]
gcc/testsuite/g++.dg/spellcheck-pr78313.C [new file with mode: 0644]