[libcxx-commits] [libcxx] [libc++] Diagnose unused variables of container types (PR #203084)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 26 08:17:15 PDT 2026


ldionne wrote:

I just spoke with @philnik777 about this patch. He explained that adding these attributes might span a relatively long time period (even across releases) because it's a lot of work to do all at once. I think that explains the concern around having a single macro to control this. However, we agreed that providing such a macro would provide some benefits and a quick way for people to disable the warnings, despite having some downsides (e.g. previously warning-free code could backslide after temporarily disabling the warnings).

So we're going to provide a macro that allows opting out of these warnings, however as new uses of this attribute are added, they are going to use the same macro. Also, this opt-out is going to be removed eventually when we feel that we've reached a fairly stable state.

To try and minimize the "cross release" effect, we're going to wait until LLVM 23 has branched before landing this, and we'll also try to give a good initial push and add the attribute to more classes in the LLVM 24 release (guarded behind the macro). That way, hopefully LLVM 24 introduces most of these warnings (behind a macro), and then LLVM 25 (or about) would remove the opt-out macro since we'd be mostly stable.

https://github.com/llvm/llvm-project/pull/203084


More information about the libcxx-commits mailing list