Fix spelling suggestions for reserved words (PR c++/80177)
commit7d5dbb22ec8e0c1f104539d3fdf2afc5174a5b45
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 25 Apr 2017 13:34:50 +0000 (25 13:34 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 25 Apr 2017 13:34:50 +0000 (25 13:34 +0000)
treecb97cfa4afc5343f61e406a573fd5fe602802a4e
parent0f168ccca1bb7a72e5456f9a6ff82a256e774073
Fix spelling suggestions for reserved words (PR c++/80177)

gcc/cp/ChangeLog:
PR c++/80177
* name-lookup.c (suggest_alternative_in_explicit_scope): Convert
candidate type of bm from tree to const char *.
(consider_binding_level): Likewise.
(lookup_name_fuzzy): Likewise, using this to merge the best
result from the preprocessor into bm, rather than immediately
returning, so that better matches from reserved words can "win".
Guard the rejection of keywords that don't start decl-specifiers
so it only happens for FUZZY_LOOKUP_TYPENAME.

gcc/testsuite/ChangeLog:
PR c++/80177
* g++.dg/spellcheck-pr80177.C: New test case.

From-SVN: r247233
gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/spellcheck-pr80177.C [new file with mode: 0644]