This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51454] New: For loop improper scoping
- From: "pubby.8 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Dec 2011 17:54:17 +0000
- Subject: [Bug c++/51454] New: For loop improper scoping
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: pubby.8@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) { ; }
}