[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions
Hans Wennborg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 30 10:04:50 PDT 2023
hans added a comment.
In D152495#4628785 <https://reviews.llvm.org/D152495#4628785>, @cor3ntin wrote:
> It is used, but only in an assert. Seems like the right fix!
I suppose it is technically, but I'm not sure the fix reads like an improvement to me... I guess that's often the case with unused variables vs. asserts though.
In D152495#4628870 <https://reviews.llvm.org/D152495#4628870>, @goncharov wrote:
> due to this change we have a enourmous number of new warnings, on the other hand -Wunused-variable is a valuable warning. I am not sure what is the policy and best practices for warnings but maybe there is a possiblity to make a transition period for enabling this type of warning separetely and to allow updating existing code?
The usual policy is to put new warnings behind new flags so users can disable them selectively. It gets trickier when it's existing warnings getting enhanced like this. Would it be possible to put this new functionality behind a flag?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152495/new/
https://reviews.llvm.org/D152495
More information about the llvm-commits
mailing list