Path: utzoo!utgpu!water!watmath!uunet!tut.cis.ohio-state.edu!mailrus!rutgers!labrea!mcnc!rti!xyzzy!duvarney From: duvarney@xyzzy.UUCP (Dan DuVarney) Newsgroups: gnu.g++.bug Subject: possible g++ bug Message-ID: <1609@xyzzy.UUCP> Date: 1 Nov 88 03:44:03 GMT Reply-To: duvarney@.UUCP () Distribution: gnu Organization: Data General Corporation, Research Triangle Park, NC Lines: 33 I am using g++ version 1.25 on a Sun 3/50 running SunOS 3.5. It appears that g++ is incorrectly choosing which constructor to use in certain cases. For example: -------------------------------------------------- #include "stream.h" class F { int i; float f; public: F(int i1, float f1); F(int i1, int i2); } F::F(int i1, float f1) { i = i1; f = f1; cout << "int, float constructor called\n"; } F::F(int i1, int i2) { i = i1 + i2; f = 0.0; cout << "int, int constructor called\n"; } main() { F f(0,0.0); } ---------------------------------------------------- When I run this program the output is "int, int constructor called." It seems to me that the int, float constructor should be called instead -- although I am a C++ novice and could be wrong. -- Dan DuVarney ...!mcnc!rti!dg-rtp!duvarney