2017-03-04 02:02:02 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core.DivideZero -analyzer-config inline-lambdas=true -analyzer-output plist -verify %s -o %t
|
2019-06-11 22:21:32 +08:00
|
|
|
// RUN: tail -n +11 %t | %normalize_plist | diff -ub %S/Inputs/expected-plists/lambda-notes.cpp.plist -
|
2015-09-12 00:55:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
// Diagnostic inside a lambda
|
|
|
|
|
|
|
|
void diagnosticFromLambda() {
|
|
|
|
int i = 0;
|
|
|
|
[=] {
|
|
|
|
int p = 5/i; // expected-warning{{Division by zero}}
|
|
|
|
(void)p;
|
|
|
|
}();
|
|
|
|
}
|