[libcxx-commits] [PATCH] D128267: [libc++] Enable [[nodiscard]] extensions by default
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jun 30 05:55:42 PDT 2022
ldionne added inline comments.
================
Comment at: libcxx/include/__config:883
// specified as such as an extension.
-# if defined(_LIBCPP_ENABLE_NODISCARD) && !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
+# if !defined(_LIBCPP_DISABLE_NODISCARD) && !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
# define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD
----------------
This whole thing is really confusing, and I think we need to clean it up. We have:
```
_LIBCPP_DISABLE_NODISCARD
_LIBCPP_DISABLE_NODISCARD_EXT
_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17
```
I don't understand why we have all that. We should only have one knob: `_LIBCPP_DISABLE_NODISCARD_EXT`, which would disable the nodiscards that we added as an extension.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D128267/new/
https://reviews.llvm.org/D128267
More information about the libcxx-commits
mailing list