[Bug c++/5520] Add a warning to detect empty body of if statements (like in the C frontend)
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Jan 20 09:30:00 GMT 2006
------- Comment #9 from rguenth at gcc dot gnu dot org 2006-01-20 09:30 -------
Subject: Bug 5520
Author: rguenth
Date: Fri Jan 20 09:30:22 2006
New Revision: 110019
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110019
Log:
2006-01-20 Dirk Mueller <dmueller@suse.com>
PR c++/5520
* c-parser.c (c_parser_if_body): Use build_empty_stmt()
instead of a special NOP marker.
* c-typeck.c (c_finish_if_stmt): Remove obsoleted special
NOP marker handling.
* c-common.h (empty_body_warning): Add forward declaration.
* c-common.c (empty_body_warning): Add (from c_finish_if_stmt).
Now uses IS_EMPTY_STMT() instead of special NOP markers.
* semantics.c (finish_if_stmt): Call empty_body_warning.
* parser.c (cp_parser_implicitly_scoped_statement):
Mark empty statement with an empty stmt.
* g++.dg/warn/empty-body.C: New.
Added:
trunk/gcc/testsuite/g++.dg/warn/empty-body.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-common.c
trunk/gcc/c-common.h
trunk/gcc/c-parser.c
trunk/gcc/c-typeck.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5520
More information about the Gcc-bugs
mailing list