c.opt (Wdangling-else): New option.
authorMarek Polacek <polacek@redhat.com>
Wed, 4 May 2016 16:00:33 +0000 (16:00 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 4 May 2016 16:00:33 +0000 (16:00 +0000)
commitdeef71132774618d06d571e935d10753f92d8ad9
tree8b890b5273bda4aece838374284c4c95a65d2d0c
parent5396db971eb7a0997e9bcf15b2f9bda4db003b87
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
12 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wdangling-else-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/Wdangling-else-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/Wdangling-else-3.c [new file with mode: 0644]