Article View: gnu.g++.bug
Article #347no error message when non-existent constructor is called.
From: David Detlefs
Date: Mon, 14 Aug 1989 21:53
Date: Mon, 14 Aug 1989 21:53
32 lines
1040 bytes
1040 bytes
Michael et. al. --
G++ 1.35.0 on a uvax3.
Consider the following program:
--------------------------------------------------
#include <stream.h>
struct foo {
public:
foo();
private:
int i;
};
foo::foo() { cout << "Hello.\n"; }
void main() {
foo f(7);
}
--------------------------------------------------
This should give an error message, because there is no "foo"
constructor that takes an integer argument. Instead if gives no
argument. Even more insidious, it does not call the default
constructor -- when run, the above program prints nothing.
Thanks. Ad astra.
Dave
Technical Details
Message-ID:
<8908161258.AA00930@AENEAS.MIT.EDU>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!watmath!uunet!tut.cis.ohio-state.edu!JMW.LARCH.CS.CMU.EDU!dldShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!watmath!uunet!tut.cis.ohio-state.edu!JMW.LARCH.CS.CMU.EDU!dld From: dld@JMW.LARCH.CS.CMU.EDU (David Detlefs) Newsgroups: gnu.g++.bug Subject: no error message when non-existent constructor is called. Message-ID: <8908161258.AA00930@AENEAS.MIT.EDU> Date: 14 Aug 89 21:53:51 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 32