summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-unused-lambda-capture.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[Sema] Reword warning for constant captures that are not required"Benjamin Kramer2018-07-171-6/+6
| | | | | | | | This reverts commit r337152. This applies to non-constants too. The real explanation is that the capture is not ODR-used, but putting that into the warning message seems ... worse. llvm-svn: 337278
* [Sema] Reword warning for constant captures that are not requiredBenjamin Kramer2018-07-161-6/+6
| | | | | | | | | This is one of the darker corners of C++, make it clear that this is about constants and rephrase it a bit. Before: lambda capture 'i' is not required to be captured for this use After: lambda capture of constant 'i' is not required for this use llvm-svn: 337152
* [Sema] Fix crash in unused-lambda-capture warning for VLAsMalcolm Parsons2017-12-111-0/+9
| | | | | | | | | | | | | | | | | | | | Summary: Clang was crashing when diagnosing an unused-lambda-capture for a VLA because From.getVariable() is null for the capture of a VLA bound. Warning about the VLA bound capture is not helpful, so only warn for the VLA itself. Fixes: PR35555 Reviewers: aaron.ballman, dim, rsmith Reviewed By: aaron.ballman, dim Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41016 llvm-svn: 320396
* Fix spurious Wunused-lambda-capture warningYi Kong2017-06-131-0/+5
| | | | | | | | | | | | | | | | | Summary: Clang emits unused-lambda-capture warning for captures in generic lambdas even though they are actually used. Fixes PR31815. Reviewers: malcolm.parsons, aaron.ballman, rsmith Reviewed By: malcolm.parsons Subscribers: ahatanak, cfe-commits Differential Revision: https://reviews.llvm.org/D33526 llvm-svn: 305315
* [Sema] Improve side effect checking for unused-lambda-capture warningMalcolm Parsons2017-03-011-3/+77
| | | | | | | | | | | | | | | | Summary: Don't warn about unused lambda captures that involve copying a value of a type that cannot be trivially copied and destroyed. Fixes PR31977 Reviewers: rsmith, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30327 llvm-svn: 296602
* [Sema] Reword unused lambda capture warningMalcolm Parsons2017-01-191-3/+7
| | | | | | | | | | | | | | | Summary: The warning doesn't know why the variable was looked up but not odr-used, so reword it to not claim that it was used in an unevaluated context. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28902 llvm-svn: 292498
* [Sema] Add warning for unused lambda capturesMalcolm Parsons2017-01-131-0/+110
Summary: Warn when a lambda explicitly captures something that is not used in its body. The warning is part of -Wunused and can be enabled with -Wunused-lambda-capture. Reviewers: rsmith, arphaman, jbcoe, aaron.ballman Subscribers: Quuxplusone, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D28467 llvm-svn: 291905
OpenPOWER on IntegriCloud