teak-llvm/clang/test/Analysis/lambda-notes.cpp
Reid Kleckner e7ea1834f4 Revert r362994 & co "[analyzer][tests] Add normalize_plist to replace diff_plist"
Reverts r362998, r362996, and r362994 because the tests do not pass on
Windows due to CRLF changes. Adding back `-w` to diff is not enough, the
new grep substitution doesn't work on Windows, and fixing it is
non-trivial.

llvm-svn: 363007
2019-06-10 23:25:43 +00:00

14 lines
400 B
C++

// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core.DivideZero -analyzer-config inline-lambdas=true -analyzer-output plist -verify %s -o %t
// RUN: tail -n +11 %t | %diff_plist %S/Inputs/expected-plists/lambda-notes.cpp.plist -
// Diagnostic inside a lambda
void diagnosticFromLambda() {
int i = 0;
[=] {
int p = 5/i; // expected-warning{{Division by zero}}
(void)p;
}();
}