This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47332] New: g++ compiler should check for empty while or for bodies


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]