[comp.lang.c++] cfront dies on the following

flanagan@odin.cs.cornell.edu (Doug Flanagan) (11/30/88)

One of our C++ users is having a problem with the AT&T C++ 1.2 I installed on
our Sun 3's. His description:

/* File t.c */

struct A { int i; };
struct B { A& a; B(A&);}; // B::a is a reference to variable of type A
B::B(A& b) : a(b) {} //line 5:  initialization of B::a to b causes trouble

/* 
This is what happens when you try to compile this file on a SUN 3/50:

% CC -c t.c
CC  t.c:
"t.c", line 5: internal <<cfront 1.2.1 2/16/87>> error: bus error (or something nasty like that)
1 error
%

Compiling with flag -Fc one finds that cfront gets into the definition
of B::B(A&) but dies at the point where it wants to initialize B::a; the 
last fragment of a line it writes is 
                            _au0_this -> _B_a = 
after which it dies. On a MacII (rather than a SUN 3/50) cfront 
often gets past this point, and does the right thing. However it usually
has trashed something else in memory, often leading to rather interesting
consequences 5-10 minutes later. 
*/


Is there a bug fix I can install which will help? Is 1.2.1 the most
recent version of cfront? Is there a mistake in this users program?

Thanks. Please reply to flanagan@lnssun1.tn.cornell.edu

-Doug Flanagan
 Nuclear Studies
 Cornell U.