aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include
diff options
context:
space:
mode:
authorNikolas Klauser <nikolasklauser@berlin.de>2022-09-01 12:02:58 +0200
committerNikolas Klauser <nikolasklauser@berlin.de>2022-09-02 21:34:20 +0200
commit3c355e2881887fea6f4b31e26b68aefa4d216fd0 (patch)
tree337d8829396bfe38d4ad92774e547bf0518ac0f8 /libcxx/include
parent7691b69d5b2f5e9d8b210add22926335b3541444 (diff)
downloadllvm-3c355e2881887fea6f4b31e26b68aefa4d216fd0.zip
llvm-3c355e2881887fea6f4b31e26b68aefa4d216fd0.tar.gz
llvm-3c355e2881887fea6f4b31e26b68aefa4d216fd0.tar.bz2
[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
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/__config4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index fbf1752..77b1593 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -858,13 +858,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
// _LIBCPP_NODISCARD_EXT may be used to apply [[nodiscard]] to entities not
// specified as such as an extension.
-# if defined(_LIBCPP_ENABLE_NODISCARD_EXT)
+# if !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
# define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD
# else
# define _LIBCPP_NODISCARD_EXT
# endif
-# if _LIBCPP_STD_VER > 17 || defined(_LIBCPP_ENABLE_NODISCARD_EXT)
+# if _LIBCPP_STD_VER > 17 || !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
# define _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_NODISCARD
# else
# define _LIBCPP_NODISCARD_AFTER_CXX17