Fix spelling suggestions for reserved words (PR c++/80177)
commit945c615989cddb36a8426a8cd66c3fa058d7128e
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 25 Apr 2017 13:34:50 +0000 (25 13:34 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 25 Apr 2017 13:34:50 +0000 (25 13:34 +0000)
treecb97cfa4afc5343f61e406a573fd5fe602802a4e
parent5e67c1f83f36d04eda9e8c7538e56497b0700e5c
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247233 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/spellcheck-pr80177.C [new file with mode: 0644]