Do not suggest -fsanitize=all (PR driver/78863).

PR driver/78863
	* gcc.c (driver::build_option_suggestions): Do not add
	-fsanitize=all as a suggestion candidate.
	PR driver/78863
	* gcc.dg/spellcheck-options-13.c: New test.

From-SVN: r243857
This commit is contained in:
Martin Liska 2016-12-21 15:05:10 +00:00
parent 592e4d9459
commit b0a3329db0
4 changed files with 28 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2016-12-21 Jakub Jelinek <jakub@redhat.com>
Martin Liska <mliska@suse.cz>
PR driver/78863
* gcc.c (driver::build_option_suggestions): Do not add
-fsanitize=all as a suggestion candidate.
2016-12-21 Alexander Monakov <amonakov@ispras.ru>
PR target/78831

View file

@ -7733,6 +7733,17 @@ driver::build_option_suggestions (void)
{
for (int j = 0; sanitizer_opts[j].name != NULL; ++j)
{
struct cl_option optb;
/* -fsanitize=all is not valid, only -fno-sanitize=all.
So don't register the positive misspelling candidates
for it. */
if (sanitizer_opts[j].flag == ~0U && i == OPT_fsanitize_)
{
optb = *option;
optb.opt_text = opt_text = "-fno-sanitize=";
optb.cl_reject_negative = true;
option = &optb;
}
/* Get one arg at a time e.g. "-fsanitize=address". */
char *with_arg = concat (opt_text,
sanitizer_opts[j].name,

View file

@ -1,3 +1,8 @@
2016-12-21 Martin Liska <mliska@suse.cz>
PR driver/78863
* gcc.dg/spellcheck-options-13.c: New test.
2016-12-21 Alexander Monakov <amonakov@ispras.ru>
* gcc.target/nvptx/decl-shared.c (v_common): Add 'common' attribute to

View file

@ -0,0 +1,5 @@
/* PR driver/78863. */
/* { dg-do compile } */
/* { dg-options "-fsanitize" } */
/* { dg-error "unrecognized command line option .-fsanitize..$" "" { target *-*-* } 0 } */