diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-30 14:28:50 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-30 14:28:50 +0000 |
commit | 413c4f6cc73ad5380fb4a533d7b60dd3de7386ed (patch) | |
tree | 40d1bc99d4ff173785ae8b7f061698acb8a05f26 /gcc/gcc.c | |
parent | adc565bd1d50272e67cc6789d203931f402697e5 (diff) | |
download | gcc-413c4f6cc73ad5380fb4a533d7b60dd3de7386ed.tar.gz |
Fix bogus option suggestions for RejectNegative options (PR driver/71651)
gcc/ChangeLog:
PR driver/71651
* gcc.c (driver::build_option_suggestions): Pass "option" to
add_misspelling_candidates.
* opts-common.c (add_misspelling_candidates): Add "option" param;
use it to avoid adding negated forms for options marked with
RejectNegative.
* opts.h (add_misspelling_candidates): Add "option" param.
gcc/testsuite/ChangeLog:
PR driver/71651
* gcc.dg/spellcheck-options-12.c: New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237880 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index ab113102bc6..634f8e6002a 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -7700,12 +7700,14 @@ driver::build_option_suggestions (void) for (unsigned j = 0; e->values[j].arg != NULL; j++) { char *with_arg = concat (opt_text, e->values[j].arg, NULL); - add_misspelling_candidates (m_option_suggestions, with_arg); + add_misspelling_candidates (m_option_suggestions, option, + with_arg); free (with_arg); } } else - add_misspelling_candidates (m_option_suggestions, opt_text); + add_misspelling_candidates (m_option_suggestions, option, + opt_text); break; case OPT_fsanitize_: @@ -7729,7 +7731,8 @@ driver::build_option_suggestions (void) /* Add with_arg and all of its variant spellings e.g. "-fno-sanitize=address" to candidates (albeit without leading dashes). */ - add_misspelling_candidates (m_option_suggestions, with_arg); + add_misspelling_candidates (m_option_suggestions, option, + with_arg); free (with_arg); } } |