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

Nico Weber thakis at chromium.org
Tue Apr 10 20:49:04 PDT 2012


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.

Nico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libcxx-unused.patch
Type: application/octet-stream
Size: 2226 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120410/975e81f6/attachment.obj>


More information about the cfe-commits mailing list