opts: improve option suggestion
authorMartin Liska <mliska@suse.cz>
Wed, 11 May 2022 14:07:25 +0000 (16:07 +0200)
committerMartin Liska <mliska@suse.cz>
Thu, 16 Jun 2022 06:23:06 +0000 (08:23 +0200)
commitab66fd016d8efa250c471692f826b07e4a55e237
tree45b33fca45bceb9bdb8900bc8d3e9fa25b2346cc
parentb18e5d7e5f9df69759f0fbc2bed91d5e51313e79
opts: improve option suggestion

In case where we have 2 equally good candidates like
-ftrivial-auto-var-init=
-Wtrivial-auto-var-init

for -ftrivial-auto-var-init, we should take the candidate that
has a difference in trailing sign symbol.

PR driver/105564

gcc/ChangeLog:

* spellcheck.cc (test_find_closest_string): Add new test.
* spellcheck.h (class best_match): Prefer a difference in
trailing sign symbol.
gcc/spellcheck.cc
gcc/spellcheck.h