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

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 7 11:04:46 PDT 2021


ldionne added a comment.

Okay, so FWIW, I ran this on a significant code base internally and found only a reasonable number of hits, all of which appeared to be bugs just waiting to happen. So I'm supportive of this as a general idea.

Here's how I'd like us to do this:

1. I'd like us to keep `_LIBCPP_NODISCARD_EXT` as a documentation of what is a libc++ specific extension and what is not.
2. 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*.
3. In two releases, we remove the knob and `_LIBCPP_NODISCARD_EXT` is always enabled, period.

That will let code bases adopt the change incrementally over roughly one year. In particular, I'd like to avoid significant breakage in open-source code bases without giving them a way to opt-out until they've had the time to fix their errors. WDYT?


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