Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!asuvax!noao!arizona!sunquest!francis From: francis@sunquest.UUCP (Francis Sullivan) Newsgroups: comp.lang.c++ Subject: Why does cfront 2.0 give this error? Message-ID: <2135@sunquest.UUCP> Date: 26 Feb 90 23:43:41 GMT Organization: Sunquest Information Systems, Tucson Lines: 59 The example below reproduces what I think is a minor bug in cfront 2.0 Does anyone know why the public namespace for the class constructor has the protected (or private) class constructors thrown in? ###### sun cfront 2.0 output ####### CC -sun4 -o prot prot.cc CC prot.cc: "prot.cc", line 36: error: two standard conversions possible for Goo::Goo(): struct Goo *Goo::(SomeStruct *) and struct Goo *Goo::(char *) "prot.cc", line 36: error: main() cannot access Goo::Goo(): protected member 2 errors ###### the input file: ####### #include class Goo { protected: struct SomeStruct { int i; }; SomeStruct *ss; char * name; Goo(SomeStruct *nss) { ss = nss; name = "fred"; } public: Goo(char *nname) { if (name == 0) name = "bertha"; else name = nname; ss = new SomeStruct; ss->i = 123; } Goo(const Goo& g) { name = g.name; ss = g.ss; } Goo duugh() { SomeStruct *nss = new SomeStruct; nss->i = 1; return Goo(nss); } void show() { cout << "ss->i is " << ss->i << ", name is " << name << "\n"; } }; main() { Goo a("harold"); Goo b(0); // line 36, I want to call the public Goo constructor!!! Goo c = b.duugh(); a.show(); b.show(); c.show(); } ############ end of input file ##### -- Francis Sullivan Sunquest Information Systems Tucson, AZ email: francis@sunquest.com or sunquest!francis@arizona.edu or {uunet,arizona}!sunquest!francis