__nodiscard adds the [[nodiscard]] attribute to a function, type or
constructor in C or C++, causing a value so marked to issue a compiler
warning if it is discarded (i.e., not used or assigned) other than by
casting it to void.
[[nodiscard]] has been supported in C++ since C++17, but only in C since
C23; however, both LLVM and GCC implement it even in older language
versions, so it should always be available with a relatively modern
compiler.
don't fall back to warn_unused_result if nodiscard isn't available,
because it has different semantics (e.g., it cannot be applied to a
type).
MFC after: 3 days