[libcxx-commits] [PATCH] D108080: [libcxx] simplifies nodiscard by permanently enabling the attribute...

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 7 13:59:14 PDT 2021


Quuxplusone added a comment.

@ldionne wrote:

> Here's how I'd like us to do this:
> I'd like us to keep _LIBCPP_NODISCARD_EXT as a documentation of what is a libc++ specific extension and what is not.
> We should make _LIBCPP_NODISCARD_EXT enabled by default, and add a knob that allows removing it. We can document the knob that allows removing those extensions **and mention that the knob will be removed within 2 releases.**
> In two releases, we remove the knob and _LIBCPP_NODISCARD_EXT is always enabled, period.

I'm happy with the first 1.5 parts, and skeptical-of-but-not-objecting-to the second 1.5 parts (the part where you can ever actually remove the deprecated knob). To make sure we're on the same page, though: You're proposing that two releases from now we **remove the //_LIBCPP_DISABLE_NODISCARD_EXT// macro and its tests**, but we **continue marking all our extensions using the //_LIBCPP_NODISCARD_EXT// macro**, right? You're //not// proposing that two releases from now we do a massive search-and-replace of `_LIBCPP_NODISCARD_EXT` into `[[nodiscard]]`, right? (Because I would object to that; and I also think it'd have logistical problems because C++03 doesn't support `[[nodiscard]]` — all the same arguments from `_EnableIf` apply here. Fortunately, my understanding is that you're **not** proposing such a massive search-and-replace, so it's a moot point, thank you.)
TLDR I'd like to be reassured that we're not search-and-replacing `_LIBCPP_NODISCARD_EXT` itself; but assuming I'm right about that, then your plan sounds perfect.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108080



More information about the libcxx-commits mailing list