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

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 22 14:56:08 PDT 2026


philnik777 wrote:

> > Not if I don't think it's beneficial. IMO the macro is worse to read and improves nothing to make up for that. If I understand why you want it and think it's a reasonable ask I may be persuaded, but (especially the first part) isn't there so far.
> 
> Risk of repeating myself: I don't want to start diagnosing unused containers overnight and want to opt out of this change temporarily. I want a simpler change than having to apply a reverse patch to this PR. The PR as is today provides no option to revert to the previous behaviour. The benefit here being giving people the time to test this change and migrate.

Right. My point before was that this doesn't help whatsoever after the first patch, so I don't think it's actually buying you much. If I come along with another patch in three days that applied the attribute to another 20 places you would be no better off than if I didn't add a macro at all. Why is it for the first patch important to have a single line instead of 20 but not for the second one?

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


More information about the libcxx-commits mailing list