c++: Make spell corrections consistent
authorNathan Sidwell <nathan@acm.org>
Mon, 5 Oct 2020 13:36:38 +0000 (06:36 -0700)
committerNathan Sidwell <nathan@acm.org>
Mon, 5 Oct 2020 13:39:10 +0000 (06:39 -0700)
commit255aa06d40d7b151d1b26cb690e0545f834b3bea
tree4b4cea6517eef8932ca814464454c8c0a88a0813
parentbf490f0636052040cfe1b3882475ac9a0e0337df
c++: Make spell corrections consistent

My change to namespace-scope spell corrections ignored the issue that
different targets might have different builtins, and therefore perturb
iteration order.  This fixes it by using an intermediate array of
identifier, which we sort before considering.

gcc/cp/
* name-lookup.c (maybe_add_fuzzy_decl): New.
(maybe_add_fuzzy_binding): New.
(consider_binding_level): Use intermediate sortable vector for
namespace bindings.
gcc/testsuite/
* c-c++-common/spellcheck-reserved.c: Restore diagnostic.
gcc/cp/name-lookup.c
gcc/testsuite/c-c++-common/spellcheck-reserved.c