Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!CS.UCL.AC.UK!T.Day From: T.Day@CS.UCL.AC.UK (Tim Day) Newsgroups: gnu.g++.bug Subject: virtual default args problem Message-ID: <8905032057.AA13021@AENEAS.MIT.EDU> Date: 3 May 89 20:50:45 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 37 The below example gives a 'Program c++ got fatal signal 6.' under g++ version 1.34.2. --------- #include String blurb("bleah"); class Foo { String a; public: Foo() {} virtual void scooby(String s=blurb) {a=s;} virtual void doobie(String s=String("bleaurgh")) {a=s;} }; class Bar : public Foo { String b; public: Bar() {} virtual void scooby(String s=blurb) {b=s;} virtual void doobie(String s=String("bleaurgh")) {b=s;} // Above line causes problem }; main() { Foo x; Bar y; exit(0); } ---------- Commenting out the 'doobie' member function of 'Bar' eliminates this. I'm not sure if this sort of default arg. should be allowed anyway since the two 'String("bleaurgh")'s are effectively different things, but obviously an error message of some sort is preferable Tim