[libc++] Enable [[nodiscard]] extensions by default
authorNikolas Klauser <nikolasklauser@berlin.de>
Thu, 1 Sep 2022 10:02:58 +0000 (12:02 +0200)
committerNikolas Klauser <nikolasklauser@berlin.de>
Fri, 2 Sep 2022 19:34:20 +0000 (21:34 +0200)
commit3c355e2881887fea6f4b31e26b68aefa4d216fd0
tree337d8829396bfe38d4ad92774e547bf0518ac0f8
parent7691b69d5b2f5e9d8b210add22926335b3541444
[libc++] Enable [[nodiscard]] extensions by default

Adding `[[nodiscard]]` to functions is a conforming extension and done extensively in the MSVC STL.

Reviewed By: ldionne, EricWF, #libc

Spies: #libc_vendors, cjdb, mgrang, jloser, libcxx-commits

Differential Revision: https://reviews.llvm.org/D128267
16 files changed:
libcxx/docs/ReleaseNotes.rst
libcxx/docs/UsingLibcxx.rst
libcxx/include/__config
libcxx/test/libcxx/algorithms/callable.verify.cpp
libcxx/test/libcxx/diagnostics/enable_nodiscard_ext.verify.cpp [deleted file]
libcxx/test/libcxx/diagnostics/nodiscard.pass.cpp
libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.verify.cpp
libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp
libcxx/test/libcxx/diagnostics/nodiscard_extensions.verify.cpp
libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.verify.cpp
libcxx/test/std/algorithms/alg.sorting/alg.merge/ranges_inplace_merge.pass.cpp
libcxx/test/std/algorithms/alg.sorting/alg.min.max/requires_forward_iterator.fail.cpp
libcxx/test/std/algorithms/robust_against_proxy_iterators_lifetime_bugs.pass.cpp
libcxx/test/std/containers/container.node/node_handle.nodiscard.verify.cpp
libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.verify.cpp
libcxx/test/std/utilities/memory/ptr.align/assume_aligned.nodiscard.verify.cpp