diff options
author | Marek Polacek <polacek@redhat.com> | 2016-05-04 16:00:33 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-05-04 16:00:33 +0000 |
commit | deef71132774618d06d571e935d10753f92d8ad9 (patch) | |
tree | 8b890b5273bda4aece838374284c4c95a65d2d0c /gcc/c/c-parser.c | |
parent | 5396db971eb7a0997e9bcf15b2f9bda4db003b87 (diff) | |
download | gcc-deef71132774618d06d571e935d10753f92d8ad9.zip gcc-deef71132774618d06d571e935d10753f92d8ad9.tar.gz gcc-deef71132774618d06d571e935d10753f92d8ad9.tar.bz2 |
c.opt (Wdangling-else): New option.
* c.opt (Wdangling-else): New option.
* c-parser.c (c_parser_if_statement): Replace OPT_Wparentheses with
OPT_Wdangling_else.
* parser.c (cp_parser_selection_statement): Replace OPT_Wparentheses
with OPT_Wdangling_else.
* doc/invoke.texi: Document -Wdangling-else.
* c-c++-common/Wdangling-else-1.c: New test.
* c-c++-common/Wdangling-else-2.c: New test.
* c-c++-common/Wdangling-else-3.c: New test.
From-SVN: r235885
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r-- | gcc/c/c-parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 701ab45..d275f8e 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -5542,7 +5542,7 @@ c_parser_if_statement (c_parser *parser, bool *if_p, vec<tree> *chain) /* Diagnose an ambiguous else if if-then-else is nested inside if-then. */ if (nested_if) - warning_at (loc, OPT_Wparentheses, + warning_at (loc, OPT_Wdangling_else, "suggest explicit braces to avoid ambiguous %<else%>"); if (warn_duplicated_cond) |