This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Temporary created with default constructor in return bogus error


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]