[cfe-commits] [Patch][libc++] Mark vector:: and string::empty() as warn_unused_result

Chris Lattner clattner at apple.com
Wed Apr 11 11:57:01 PDT 2012


On Apr 10, 2012, at 8:49 PM, Nico Weber wrote:

> Hi,
> 
> the attached patch marks vector:: and string::empty() as
> warn_unused_result. It looks like it's fairly often confused with
> clear() in practice:
> 
> https://breakpad.appspot.com/377003/
> http://codereview.chromium.org/10034006/
> http://www.viva64.com/en/a/0079/ (search for "empty")
> 
> See also http://llvm.org/bugs/show_bug.cgi?id=10011 for a more general approach.

Besides, wouldn't it be better to mark it as "pure"?

-Chris



More information about the cfe-commits mailing list