[PATCH] D28467: [Sema] Add warning for unused lambda captures

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 13 08:52:47 PST 2017


aaron.ballman added a comment.

In https://reviews.llvm.org/D28467#645348, @malcolm.parsons wrote:

> http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/1122/steps/bootstrap%20clang/logs/stdio
>
>   /home/buildbots/ppc64be-sanitizer/sanitizer-ppc64be/build/llvm/lib/Analysis/ValueTracking.cpp:1116:17: error: lambda capture 'BitWidth' is not used [-Werror,-Wunused-lambda-capture]
>       auto KOF = [BitWidth](const APInt &KnownOne, unsigned ShiftAmt) {
>                   ^
>   /home/buildbots/ppc64be-sanitizer/sanitizer-ppc64be/build/llvm/lib/Analysis/ValueTracking.cpp:1127:17: error: lambda capture 'BitWidth' is not used [-Werror,-Wunused-lambda-capture]
>       auto KZF = [BitWidth](const APInt &KnownZero, unsigned ShiftAmt) {
>                   ^
>   /home/buildbots/ppc64be-sanitizer/sanitizer-ppc64be/build/llvm/lib/Analysis/ValueTracking.cpp:1131:17: error: lambda capture 'BitWidth' is not used [-Werror,-Wunused-lambda-capture]
>       auto KOF = [BitWidth](const APInt &KnownOne, unsigned ShiftAmt) {
>                   ^
>   3 errors generated.
>
>
> The warnings are correct.
>
> Should I remove the unused lambda captures or revert this changeset?


The warnings look correct to me; I think you should remove the unused lambda captures (no need for a test or review since changes are NFC).


Repository:
  rL LLVM

https://reviews.llvm.org/D28467





More information about the cfe-commits mailing list