Problem default type converting

Sebastian Huber sebastian-huber@web.de
Tue Oct 8 02:01:00 GMT 2002


Hello Henrik,
your C++ is correct and compiles at least with 2.95.3. I guess that you have 
discoverd another shortcomming of gcc 2.96.

Ciao
 
On Tuesday 08 October 2002 01:36, Henrik Nilsson \(Developer\) wrote:
> I'm using GCC 2.96 on Linux
> My code
>
> class CString{
> 	CString()
> 	CString(const char *)
> }
>
> class MyClass{
> 	f(const CString  &s){}
> }
>
> MyClass my;
> my.f("")
>
> Then I get compiler error.
> Due to the C++ standard my.f("") should create a temp object like this
> my.f(CString("")) but instead
> I get compiler error
>
> This is not a big problem I'm just surprised that it seems like GCC is not
> following the standard.
>
> Any one who know more abot this?
> Henrik



More information about the Gcc-help mailing list