[cfe-dev] Reaching the end of a value-returning function in C++

Argyrios Kyrtzidis kyrtzidis at apple.com
Mon Oct 15 11:39:16 PDT 2012


On Oct 12, 2012, at 9:44 PM, Sean Silva <silvas at purdue.edu> wrote:

>>> template <class _CharT, class _Traits>
>>> inline _LIBCPP_INLINE_VISIBILITY
>>> basic_filebuf<_CharT, _Traits>&
>>> basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs)
>>> {
>>>    close();
>>>    swap(__rhs);
>>> }
>> 
>> Notice the absence of a "return *this".
> 
> Shouldn't -Wreturn-type have caught this?

It slipped by due to warnings getting suppressed inside system headers.

> 
> -- Sean Silva
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list