Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!texbell!attctc!pollux!ti-csl!m2!neath From: neath@solar-1.stars.flab.Fujitsu.JUNET Newsgroups: comp.lang.c++ Subject: const char*& in cfront 2.0 Message-ID: Date: 17 Oct 89 02:08:25 GMT Sender: news@ti-csl.csc.ti.com Distribution: comp.lang.c++ Organization: Texas Instruments Data Systems Group, Austin TX Lines: 57 We have recently upgraded from version 1.2 to 2.0 of the AT&T translator and are now having problems getting some of our code to compile. In particular, references to literal character strings seem to be handled differently under some circumstances. Consider the following external declaration and function: extern bar (const char *const &s); char* s = "abc"; void foo () { bar (s); bar ("abc"); } No problem here -- everything works as expected under both versions of cfront. Now take the following simple class definition and small function: class dummy { public: dummy (const char *const &); }; void baz () { dummy a(s); dummy b("abc"); } Again, no problem trying to compile under both 1.2 and 2.0 versions of cfront. However, if I now explicitly add a constructor to dummy that has no arguments and try to compile, I get the following: class dummy2 { public: dummy2 (); dummy2 (const char *const &); }; void baz2 () { dummy2 a(s); dummy2 b("abc"); } % CC2 -c dummy2.C "dummy2.C", line 8: error: bad argument list for baz2::baz2() (no match against any baz2::baz2()) 1 error This same code works find under version 1.2 of cfront. I do not understand why this causes an error? Is there something wrong with what I am trying to do that generates an error because of the tightening of dismabiguity rules in 2.0? Any help and/or insight into this problem will be greatly appreciated! Regards Martin Neath ------------------------------------------------------------------------ DISCLAIMER: As always, the opinions expressed above are strictly my own and do not reflect those of my employer, Texas Instruments. ------------------------------------------------------------------------