...for anything that already had _LIBCPP_NODISCARD_EXT or
_LIBCPP_NODISCARD_AFTER_CXX17.
nodiscard in libc++ has had multi-layered complexity for quite some
time, requiring users to know that they need to opt into a lot of what
we mark as nodiscard. There are also many knobs: an opt-in mechanism
(that users can easily overlook) and three opt-out mechanisms, which can
lead to confused users.
This patch does not break any code that wasn't already buggy or
questionable to begin with.
This PR seems acceptable to me. (I think it's likely better than the status quo, because it's simpler.) However, I'd still prefer to see libc++ distinguish the "conforming implementation" parts from the "non-conforming" parts. After all, this is supposed to be a valid C++ program, right?
With this PR, libc++ will refuse to compile that program, so libc++ won't technically be conforming anymore. This could piss off customers with big old codebases. Whenever we do an API-breaking change, it's useful to give customers a way to opt out of it.
So, I counterpropose that we still do most of this simplification, but: