[libcxx-commits] [libcxx] [libc++] Diagnose unused variables of container types (PR #203084)
Yuxuan Chen via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jun 17 16:58:29 PDT 2026
yuxuanchen1997 wrote:
> When would the spelling ever change? I've never seen that happen, after one was released.
In my experience, if something isn't guaranteed to not change there's always a chance it will. It isn't always about the spelling. If newer GCC introduces a behaviour about this attribute that we no longer like any more, the PR to unapply/substitute it would have a large blast radius.
> Edit: generally macros tend to produce worse diagnostics, so I'd rather avoid them if feasible.
I think there are two kinds of diagnostics you are talking about.
One is regarding the goal of this patch, that is to enable unused variable warnings. Replacing this with a `_LIBCPP_WARN_UNUSED` is not going to affect the effectiveness of this PR.
Another is about diagnosing syntax errors within the macro itself (or the syntax constructs the macro introduced). while the latter is basically our due diligence. There's also widespread precedence in libc++ (e.g. `_LIBCPP_HIDE_FROM_ABI`)
https://github.com/llvm/llvm-project/pull/203084
More information about the libcxx-commits
mailing list