[gnu.g++.bug] scope rule bug

tiemann@LURCH.STANFORD.EDU (Michael Tiemann) (10/14/89)

   Date: Sat, 14 Oct 89 06:43:15 PDT
   From: eklee@mint.berkeley.edu (Edward K. Lee)

   I am running the unofficial release of g++ 1.36 on a sun3 running Sprite.
   (This also happens with g++ 1.35 on a sun3 running Sun UNIX 4.2 Release 3.5)

   When compiling:

   main()
   {
       for(int i = 0; i < 6; i++) {
       }
       for(int i = 0; i < 6; i++) {
       }
   }

   The compiler complains:

   g++ -v t.cc
   gcc version 1.36.0- (based on GCC 1.35.99)
    cpp -+ -v -I/user1/eklee/install.g++/lib/g++-include -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 t.cc /usr/tmp/cc530991.cpp
   GNU CPP version 1.36
    cc1plus /usr/tmp/cc530991.cpp -quiet -dumpbase t.cc -version -o /usr/tmp/cc530991.s
   GNU C++ version 1.36.0- (based on GCC 1.35.99) (68k, MIT syntax) compiled by GNU C version 1.36.
   default target switches: -m68020 -mc68020 -m68881 -mbitfield
   t.cc: In function int main ():
   t.cc:5: redeclaration of `i'
   t.cc:3: here is the previous declaration of `i'

   Ed

This is a bug in the language.  I have asked several times that the
semantics of `for' be fixed, but to no avail.  The reason given is
that it would ``break too much code''.  As I am writing this letter, I
am figuring out how to modify yet another piece of C++ code to deal
with the change in semantics of `protected'.

Michael