[comp.lang.c++] Member function bug I

cpf@batcomputer.tn.cornell.edu (Courtenay Footman) (10/23/87)

The following program fragment causes c++ to blow up with an internal
error.  (C++ version 1.2.1, running on a Sun 3/50 under Unix 3.4.)
-------------------------------------------------------------------------------
struct s_s {
    short s;
};

struct x_s {
    s_s type[2];
    int s(int i)	{ return type[i].s; }
};


void g(x_s *x)
{
    int *thing =  & x[1].s(1); // Ooops
}   // Line 14
-------------------------------------------------------------------------------
The error is always at the end of the function where the bug lives, not
the line number of the bug.
CC -c bug2.c gives:
CC  bug2.c:
"bug2.c", line 14: internal <<cfront 1.2.1 2/16/87>> error: bus error (or something nasty like that)
1 error
-- 
--------------------------------------------------------------------------------
Courtenay Footman		ARPA:	cpf@lnssun9.tn.cornell.edu
Lab. of Nuclear Studies		Usenet:	Sometimes works
Cornell University		Bitnet: cpf@CRNLNUC.BITNET