Article View: gnu.g++.bug
Article #525scope rule bug
From: Michael Tiemann
Date: Sat, 14 Oct 1989 13:48
Date: Sat, 14 Oct 1989 13:48
39 lines
1927 bytes
1927 bytes
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
Technical Details
Message-ID:
<8910141348.AA03744@lurch.Stanford.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!LURCH.STANFORD.EDU!tiemannReferences:
<8910141343.AA924223@sprite.Berkeley.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!LURCH.STANFORD.EDU!tiemann From: tiemann@LURCH.STANFORD.EDU (Michael Tiemann) Newsgroups: gnu.g++.bug Subject: scope rule bug Message-ID: <8910141348.AA03744@lurch.Stanford.EDU> Date: 14 Oct 89 13:48:25 GMT References: <8910141343.AA924223@sprite.Berkeley.EDU> Sender: daemon@tut.cis.ohio-state.edu Reply-To: tiemann@lurch.stanford.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 39