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: [email protected]
ReportedBy: [email protected]
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.