This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16012] New: [3.5 regression] trouble with scope in for statements


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]