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

             Bug #: 51454
           Summary: For loop improper scoping
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: pubb...@gmail.com


gcc version 4.7.0 20111203 (experimental) (GCC) 

This worked on 4.6, but isn't on 4.7:

for(float x = 0.0f; int x = 0;); 

error: redeclaration of ‘int x’
error: ‘float x’ previously declared here

It should be equivalent to this which compiles correctly:

{
  float x = 0.0f;
  while (int x = 0) { ; }
}

Reply via email to