* c.opt (Wdangling-else): New option.
commit1d52c456bf6b516767799042d378d0cc36733d60
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 May 2016 16:00:33 +0000 (4 16:00 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 May 2016 16:00:33 +0000 (4 16:00 +0000)
tree8b890b5273bda4aece838374284c4c95a65d2d0c
parentdc5815737294a00a461e7c67dee6a5b9b596ee96
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235885 138bc75d-0d04-0410-961f-82ee72b054a4
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]