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: g++ 2.95.2: inlining of operator<< causes SIGSEGV with -O1


> > Thanks for your bug report. It's not a bug in g++, but one in your
> > program.
> > 
> > > inline ostream& operator<<(ostream& o, const A& a) { o << "A"; }
> > 
> > Shouldn't this operator *return* something?
> 
> Shouldn't gcc complain loudly that the operator doesn't return anything?

It does, when you invoke it with -Wall. Andrew Koenig proposed that it
should do so even without an option, and I proposed a patch to always
produce a warning when there is no return statement at all, and Jason
rejected it, proposing that -Wreturn-type should be always
activated. Nothing further has been done about it so far.

Regards,
Martin


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