This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Templates break Declarations in for(;;) loops
- To: egcs-bugs at cygnus dot com
- Subject: Templates break Declarations in for(;;) loops
- From: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Date: Thu, 27 Aug 1998 20:21:23 +0200 (MET DST)
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/