[libcxx-commits] [PATCH] D129054: [libc++] Consolidate the different [[nodiscard]] configuration options into a single one

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 4 09:03:05 PDT 2022


ldionne requested changes to this revision.
ldionne added a comment.
This revision now requires changes to proceed.

This change will require some updates to the documentation, please grep for `_LIBCPP_ENABLE_NODISCARD` and `_LIBCPP_DISABLE_NODISCARD_EXT`.

I think we are on the same page in essence, but this patch does not 100% reflect that. I think we should remove all of our various nodiscard-related settings in favour of a single `_LIBCPP_DISABLE_NODISCARD_EXT`, which would be enabled by default. Then, in D128267 <https://reviews.llvm.org/D128267>, we can flip the default to `_LIBCPP_DISABLE_NODISCARD_EXT` being disabled by default (i.e. nodiscard extensions being enabled by default).



================
Comment at: libcxx/include/__config:826
 // specified as such as an extension.
-#  if defined(_LIBCPP_ENABLE_NODISCARD) && !defined(_LIBCPP_DISABLE_NODISCARD_EXT)
+#  if defined (_LIBCPP_ENABLE_NODISCARD_EXT)
 #    define _LIBCPP_NODISCARD_EXT _LIBCPP_NODISCARD
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129054/new/

https://reviews.llvm.org/D129054



More information about the libcxx-commits mailing list