Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!whuxl!whuxlm!akgua!gatech!seismo!mcvax!ukc!warwick!steve From: steve@warwick.UUCP Newsgroups: net.lang.c++ Subject: C++ bug report (#6) Message-ID: <266@euclid.warwick.UUCP> Date: Sat, 15-Mar-86 08:44:22 EST Article-I.D.: euclid.266 Posted: Sat Mar 15 08:44:22 1986 Date-Received: Mon, 17-Mar-86 04:44:18 EST Reply-To: steve@warwick.UUCP (Steve Rumsby) Distribution: net Organization: Maths Institute, Warwick University, UK Lines: 37 This is one of a series of reports of bugs found in the C++ compiler here at warwick. We have release 1.0 of the software. DESCRIPTION Cfront seems not to do all the type checking it ought to. The following code contains an assignment of "pointer to function" to "enum", which is clearly wrong, as is the generated C. EXAMPLE enum x { X_A, X_B}; class foo { x i; public: x baz() {return i;} }; main() { foo f; x y; y = (&f)->baz; } COMPILER OUTPUT CC foo.c: cc foo.i -lC "foo.c", line 14: _foo_baz undefined "foo.c", line 14: member of structure or union required "foo.c", line 14: warning: illegal combination of pointer and integer, op = -- Steve Rumsby. ...!ukc!warwick!steve.