[PATCH] D26596: [RFC] Add _LIBCPP_NO_DISCARD and apply it to unique_ptr<T>::release()

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 13 13:30:53 PST 2016


EricWF created this revision.
EricWF added reviewers: mclow.lists, chandlerc.
EricWF added a subscriber: cfe-commits.

The title says it all.

I just want to check that we agree on the general direction of this patch. Specifically that libc++ should be free to apply `no_discard` where we feel appropriate. If we agree then some other candidates are:

- Containers `empty()` and `size()` methods.
- `try_lock()` functions.
- other `release()` functions.

Additional suggestions welcome!

This patch fixes PR30898 (https://llvm.org/bugs/show_bug.cgi?id=30898)


https://reviews.llvm.org/D26596

Files:
  include/__config
  include/memory
  test/libcxx/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/release.fail.cpp
  test/libcxx/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/release.fail.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26596.77758.patch
Type: text/x-patch
Size: 3369 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161113/6512c1f3/attachment.bin>


More information about the cfe-commits mailing list