Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!sampson!russb From: russb@sampson.JPL.NASA.GOV (Russ Brill) Newsgroups: comp.lang.c++ Subject: Solar Bugs Message-ID: <11219@jpl-devvax.JPL.NASA.GOV> Date: 29 Jan 91 20:11:15 GMT Sender: news@jpl-devvax.JPL.NASA.GOV Reply-To: russb@sampson.JPL.NASA.GOV (Russ Brill) Organization: Jet Propulsion Laboratory, Pasadena, CA. Lines: 58 I have discovered what appear to me to be 2 bugs in the Sun 2.0 cfront. Am I right? Does Sun already know about these? Bug #1: When the following program is compiled, the compiler will issue a warning that D::f() has hidden B::f(int) (as it should), but it will not tell you that you must define a D::f(int), and the program will crash! #include class B { public: virtual void f(int) = 0; }; class D : public B { public: void f() {cout << "running D::f()" << endl;} }; main() { D d; B* pb = &d; pb->f(3); } [end of program] Bug #2: When the following program is compiled, it only elicits a warning (rather than the expected error) about calling a non-const member function in a const object, and the program runs as if the object were *not* const. #include class C { int i; public: C() {i = 0;} void f(int j) {i = j; cout << "new i = " << i << endl;} }; main() { const C c; c.f(3); } [end of program]