[Bug c++/16012] New: [3.5 regression] trouble with scope in for statements
reichelt at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Jun 16 07:55:00 GMT 2004
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
More information about the Gcc-bugs
mailing list