Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ISY.LIU.SE!pell From: pell@ISY.LIU.SE (P{r Emanuelsson) Newsgroups: gnu.g++.bug Subject: virtual strangeness Message-ID: <8907271739.AA02653@rainier.isy.liu.se> Date: 27 Jul 89 17:39:46 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 34 What about this? class base { public: char *data; virtual void operator=(const base& in) { printf("NYI!\n"); } }; class derived : public base { public: void operator=(base& in) { data = in.data; } }; main() { base *e = new derived; base *m = new derived; *e = *m; } With cfront 1.2 this works as (I) expected. With G++ it prints "NYI!". Why is this? Neither compiler complains about anything. Machine: Sun386i -- "Don't think; let the machine do it for you!" -- E. C. Berkeley Dept. of Electrical Engineering pell@isy.liu.se University of Linkoping, Sweden ...!uunet!isy.liu.se!pell