🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #2014

Problems with syntax errors

#2014
From: ojr
Date: Fri, 19 May 1989 10:39
66 lines
2643 bytes
I tried to send these bug-reports earlier, but I belive our
mail-system silently removed them from the spool-queue. Sorry if this
is the second mailing.

A couple of errors in the source code makes c++ dump core.
We are using g++ version 1.34.2 at a SUN 3/50 running SUNOS 4.0.1.

The following program generates a failed assertion:
---------------------- start test.cc
class b
{	// put whatever in the class
};

prog()	// forgot 'b& ref' in input
{
    b& refb = (b&) ref;
}
----------------------- end
% g++ -v test.cc
g++ version 1.34.2
 /u/gcclib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 test.cc /tmp/cca07598.cpp
GNU CPP version 1.34
 /u/gcclib/gcc-c++ /tmp/cca07598.cpp -quiet -dumpbase test.cc -noreg -version -o /tmp/cca07598.s
GNU C++ version 1.34.2 (68k, MIT syntax) compiled by GNU C version 1.34.
In function int prog ():
test.cc:7: `ref' was not declared (first use this function)
test.cc:7: (Each undeclared identifier is reported only once
test.cc:7: for each function it appears in.)
Failed assertion 0 at line 1030 of `cplus-cvt.c'.
Program c++ got fatal signal 6.






Following code generates segment violation. Compiles without error
when funcp is declared outside class. I have not looked at the
generated code though.

------------------- start test.cc
typedef (f)(...);	// should have been *f

class a
{
    f funcp;
};
--------------------- end 
% g++ -v test.cc
g++ version 1.34.2
 /u/gcclib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 test.cc /tmp/cca07638.cpp
GNU CPP version 1.34
 /u/gcclib/gcc-c++ /tmp/cca07638.cpp -quiet -dumpbase test.cc -noreg -version -o /tmp/cca07638.s
GNU C++ version 1.34.2 (68k, MIT syntax) compiled by GNU C version 1.34.
test.cc:1: warning: lazy prototyping frowned upon
test.cc:5: Segmentation violation
Program c++ got fatal signal 11.

Best regards
Ornulf Jan Rodseth				Telephone
SINTEF Dep. of Automatic Control		(+47 7) 594351 Direct
N-7034 TRONDHEIM				(+47 7) 594375 Switchboard
NORWAY						(+47 7) 594399 Fax

ojr%regtek.unit.uninett@tor.nta.no (EAN)	ojr@itk.unit.no (ARPA)
Technical Details
Message-ID: <8905191038.AA10256@inge.itk.unit.no>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!tut.cis.ohio-state.edu!itk.unit.no!ojr

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!tut.cis.ohio-state.edu!itk.unit.no!ojr
From: ojr@itk.unit.no
Newsgroups: gnu.g++.bug
Subject: Problems with syntax errors
Message-ID: <8905191038.AA10256@inge.itk.unit.no>
Date: 19 May 89 10:39:05 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 66