http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46791

           Summary: GCC fails on "for(struct { } f;;) ;", incorrectly
                    treating it as a range-based for loop
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: schaub-johan...@web.de


The following has worked correctly before, but doesn't work anymore with GCC's
range-based for-loop support enabled

void f() {
    for(struct { } f;;) ;
}

error: types may not be defined in range-based for loops

Structs in the initial part of the for loop can be useful and they are broken
by that diagnostic.

Reply via email to