This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Temporary created with default constructor in return bogus error
- To: drew at plutotech dot com
- Subject: Re: Temporary created with default constructor in return bogus error
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sun, 28 Mar 1999 08:14:09 +0200
- CC: egcs-bugs at cygnus dot com
- References: <199903280250.TAA93116@pluto.plutotech.com>
> Temporaries created using the default constructor within a return
> statement in an inline member function cause the compiler to puke
> although foo tmp = foo() works fine.
Thanks for your report. This is a known bug. The compiler mistakes the
statement for the beginning of a cast to a function type, and then
complains about the missing expression.
> iterator end () { return (iterator()); }
There is an easy work-around:
iterator end () { return iterator(); }
will be accepted.
Regards,
Martin