Article View: gnu.g++.bug
Article #720G++ 1.36.{1,2,3}
From: Alexander Klaiber
Date: Mon, 15 Jan 1990 22:45
Date: Mon, 15 Jan 1990 22:45
45 lines
2445 bytes
2445 bytes
SUN 3, OS 3
g++ 1.36.{1,2,3}
Bombs when undeclared class name used in another class declaration.
--------- file "main.c"--------------------------------------------
class Foo {
private:
Bar* bar;
};
--------- g++ -v main.c -------------------------------------------
g++ version 1.36.3 (based on GCC 1.36.92)
/usr/larry/users/klaiber/lib/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 main.c /usr/tmp/cca00819.cpp
GNU CPP version 1.36
/usr/larry/users/klaiber/lib/gcc-cc1plus /usr/tmp/cca00819.cpp -quiet -dumpbase main.c -version -o /usr/tmp/cca00819.s
GNU C++ version 1.36.3 (based on GCC 1.36.92) (68k, MIT syntax) compiled by GNU C version 1.36.
default target switches: -m68020 -mc68020 -m68881 -mbitfield
Errors detected in input file (your bison.simple is out of date)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is the problem, the rest of the compilation obviously cannot work...
but g++ still continues into the assembly phase; compiler doesn't abort!
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
as -mc68020 -o main.o /usr/tmp/cca00819.s
/usr/larry/users/klaiber/lib/gcc-ld -e start -dc -dp /lib/crt0.o /lib/Mcrt1.o main.o -lg++ /usr/larry/users/klaiber/lib/gcc-gnulib -lc -L/usr/lib/f68881
/lib/crt0.o: Undefined symbol _main referenced from text segment
--------------------------------------------------------------------
I've had this problem with g++ 1.36.{1,2,3} -- sorry for not reporting
it earlier; I thought this was already being taken care of in 1.36.2.
Adding the right declaration helps; the following compiles fine.
--------- file "okay.c"--------------------------------------------
class Bar;
class Foo {
private:
Bar* bar;
};
--------------------------------------------------------------------
This can be rather annoying if many "class" declarations are needed, since
no line number is indicated...
Alex
Technical Details
Message-ID:
<9001152245.AA17992@june.cs.washington.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!CS.WASHINGTON.EDU!klaiberShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!CS.WASHINGTON.EDU!klaiber
From: klaiber@CS.WASHINGTON.EDU (Alexander Klaiber)
Newsgroups: gnu.g++.bug
Subject: G++ 1.36.{1,2,3}
Message-ID: <9001152245.AA17992@june.cs.washington.edu>
Date: 15 Jan 90 22:45:36 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 45