[gnu.g++.bug] Problems with syntax errors

ojr@itk.unit.no (05/19/89)

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)