Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!unmvax!ogccse!adaptive!adaptive.uucp!tom From: tom@adaptive.uucp (Tom Baker) Newsgroups: comp.lang.c++ Subject: Possible cfront 1.2.1 bug Message-ID: <311@adaptive.UUCP> Date: 24 Oct 89 15:27:32 GMT Sender: tom@adaptive.UUCP Reply-To: tom@adaptive.uucp (Tom Baker) Distribution: na Organization: Adaptive Systems Inc., Portland OR Lines: 38 The following code gives a cfront 1.2.1 internal error. It appears that there are problems using pointers to member functions that have virtual functions. If the virtual function 'f' is removed from 'container' then the program compiles. I tried this with g++ 1.32.0 and it compiled fine. Is this a legal C++ program? ------------------------< cut here >--------------------------------- // compile with "CC -o bug bug.c" class container { public: virtual int f() {return(0);}; // comment this out and it works int g() {return(0);} }; typedef int (container::*mp)(); // pointer to container class fn main() { container c; mp p = &container::g; int a = (c.*p)(); // causes cfront bus error } ------------------------< cut here >--------------------------------- I get the following error message: "bug.c", line 17: internal <> error: bus error According to the documentation that I have, the program should work. Thomas Baker UUCP: ..ucbvax!ogccse!adaptive!tom Adaptive Systems, Inc. INTERNET: tom@asi.com 1400 N.W. Compton Drive, Suite 340 Beaverton, Oregon 97006