This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47332] New: g++ compiler should check for empty while or for bodies
- From: "howarth at nitro dot med.uc.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 17 Jan 2011 17:39:34 +0000
- Subject: [Bug c++/47332] New: g++ compiler should check for empty while or for bodies
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47332
Summary: g++ compiler should check for empty while or for
bodies
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: howarth@nitro.med.uc.edu
The current Apple FSF g++-4.2 compiler has a check_empty_body() routine in
gcc/cp/parser.c which provides warnings of empty bodies in for and while
statements of the form...
"suggest a space before %<;%> or explicit braces around empty body in %<%s%>
statement"
This check in the Apple g++-4.2 allowed the erroneous ";" in the for statement
in dump_eh_tree(), to be detected (PR47319). This error would have been almost
impossible to detect without the check_empty_body() routine present in Apple's
g++-4.2 and would be a useful addition to FSF gcc.