Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!pyrdc!pyrnj!rutgers!columbia!fork.columbia.edu!beshers From: beshers@fork.columbia.edu (Clifford Beshers) Newsgroups: comp.lang.c++ Subject: Bug in cfront 1.2.1. operator= not inherited properly. Message-ID: <5936@columbia.edu> Date: 12 Oct 88 17:24:52 GMT Article-I.D.: columbia.5936 Sender: news@columbia.edu Reply-To: beshers@fork.UUCP (Cliff Beshers) Organization: Columbia University Department of Computer Science Lines: 46 // The following code illustrates a bug in cfront 1.2.1 // The operator= member does not get inherited properly. // It can be invoked with the syntax b.operator=(a), but not // with b=a. #include class base_class { int d; public: base_class(int s) { d = s; } ~base_class() {} base_class& operator=(base_class& b) { d = b.d; return *this; } int data() { return d; } }; class derived_class : public base_class { public: derived_class(int i) : (i) { } }; main(int argc, char * argv[]) { derived_class a(1); derived_class b(2); b.operator=( a ); // This compiles. b = a; // This does not. } Cliff Beshers Columbia University Computer Science Department beshers@sylvester.columbia.edu