Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!bellcore!texbell!killer!rpp386!dalsqnt!pollux!ti-csl!mips!neath From: neath@solar-1.stars.flab.Fujitsu.JUNET Newsgroups: comp.lang.c++ Subject: Bug in cfront 1.2.1 Message-ID: Date: 28 Apr 89 11:59:38 GMT Sender: news@ti-csl.csc.ti.com Distribution: comp.lang.c++ Organization: Texas Instruments Data Systems Group, Austin TX Lines: 50 The following code causes an internal error and bus error in cfront version 1.2.1 when I try to compile it. I believe that this is valid, although somewhat unusual, C++ syntax. Is this acceptable code? This initialization works fine if I change private data slot 'a' from a class_b& to something like an int. ---------------------------- Cut Here ----------------------------- #include "stream.h" class class_b { int b; public: class_b(int&); void print(); }; class class_a { class_b& a; public: class_a(class_b&); }; class_a::class_a(class_b& tb) : a(tb) { a.print(); } class_b::class_b(int& i) { b = i; } void class_b::print() { cout << "This is output from class_b : b = " << b; } main() { class_b B(10); class_a A(B); // This initializer should print 10 from B } ---------------------------- Cut Here ----------------------------- Regards Martin Neath ------------------------------------------------------------------------ DISCLAIMER: As always, the opinions expressed above are strictly my own and do not reflect those of my employer, Texas Instruments. ------------------------------------------------------------------------ -- Regards, Martin