This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16012] New: [3.5 regression] trouble with scope in for statements
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jun 2004 07:55:31 -0000
- Subject: [Bug c++/16012] New: [3.5 regression] trouble with scope in for statements
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Mainline rejects the following valid program:
===============================
template<int> void foo()
{
for (int i=0 ;;) ;
for (int i=0 ;;) ;
}
void bar()
{
foo<0>();
}
===============================
with the error message:
bug.cc: In function `void foo() [with int <anonymous> = 0]':
bug.cc:9: instantiated from here
bug.cc:4: error: redeclaration of `int i'
bug.cc:3: error: `int i' previously declared here
--
Summary: [3.5 regression] trouble with scope in for statements
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16012