summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/lambdas.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Fix crash when lambda captures a variable-length array.Devin Coughlin2015-12-071-0/+13
| | | | | | | | | | | | When a C++ lambda captures a variable-length array, it creates a capture field to store the size of the array. The initialization expression for this capture is null, which led the analyzer to crash when initializing the field. To avoid this, use the size expression from the VLA type to determine the initialization value. rdar://problem/23748072 llvm-svn: 254962
* [analyzer] DeadStoresChecker: Treat locals captured by reference in C++ ↵Devin Coughlin2015-11-201-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | lambdas as escaped. The analyzer currently reports dead store false positives when a local variable is captured by reference in a C++ lambda. For example: int local = 0; auto lambda = [&local]() { local++; }; local = 7; // False Positive: Value stored to 'local' is never read lambda(); In this case, the assignment setting `local` to 7 is not a dead store because the called lambda will later read that assigned value. This commit silences this source of false positives by treating locals captured by reference in C++ lambdas as escaped, similarly to how the DeadStoresChecker deals with locals whose address is taken. rdar://problem/22165179 llvm-svn: 253630
* [analyzer] Refer to capture field to determine if capture is reference.Devin Coughlin2015-11-151-0/+72
| | | | | | | | | | | | | The analyzer incorrectly treats captures as references if either the original captured variable is a reference or the variable is captured by reference. This causes the analyzer to crash when capturing a reference type by copy (PR24914). Fix this by refering solely to the capture field to determine when a DeclRefExpr for a lambda capture should be treated as a reference type. https://llvm.org/bugs/show_bug.cgi?id=24914 rdar://problem/23524412 llvm-svn: 253157
* [analyzer] Fix lambdas that are capturing constants.Gabor Horvath2015-10-271-0/+15
| | | | llvm-svn: 251407
* [analyzer] Fix another crash when analyzing lambda functions.Gabor Horvath2015-10-271-0/+6
| | | | llvm-svn: 251404
* [analyzer] Added a missing test case for r251289.Gabor Horvath2015-10-261-0/+13
| | | | llvm-svn: 251313
* [Static Analyzer] Lambda support.Gabor Horvath2015-09-111-1/+173
| | | | | | Differential Revision: http://reviews.llvm.org/D12652 llvm-svn: 247426
* Per latest drafting, switch to implementing init-captures as if by declaringRichard Smith2013-09-281-1/+1
| | | | | | and capturing a variable declaration, and complete the implementation of them. llvm-svn: 191605
* Include lambda capture init expressions in CFG.Ted Kremenek2012-04-121-0/+20
llvm-svn: 154611
OpenPOWER on IntegriCloud