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]

Templates break Declarations in for(;;) loops


With the current CVS snapshot I get the following error

  x.cc: In function `void f()':
  x.cc:6: redeclaration of template parameter `w'
  x.cc:4:  previously declared here `N w'

for a code snippet which works fine for at least 19980810-main-branch 
and 19980827-1.1-branch.

-------- snip --------
// Build don't link:
template<class N, class O>
void f() {
    for(N w=1;;);

    if(O w=1);
    }
-------- snip --------

NOTE: With -ffor-scope this does not occur any more, so it appears to
be a (new) bug in that ``legacy mode''. 

What would be an appropriate place in the test suite to install it?
Shall I install it?

Gerald
-- 
Gerald Pfeifer (Jerry)      Vienna University of Technology
pfeifer@dbai.tuwien.ac.at   http://www.dbai.tuwien.ac.at/~pfeifer/



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