xref: /llvm-project/clang/test/Analysis/lambda-notes.cpp (revision 61c848d2549b5fa4e09776bb0a2d5306e001cb66)
1184c6242SDominic Chen // RUN: %clang_analyze_cc1 -std=c++11 -analyzer-checker=core.DivideZero -analyzer-config inline-lambdas=true -analyzer-output plist -verify %s -o %t
2*61c848d2SHubert Tong // RUN: tail -n +11 %t | %normalize_plist | diff -ub %S/Inputs/expected-plists/lambda-notes.cpp.plist -
315843343SGabor Horvath 
415843343SGabor Horvath 
515843343SGabor Horvath // Diagnostic inside a lambda
615843343SGabor Horvath 
diagnosticFromLambda()715843343SGabor Horvath void diagnosticFromLambda() {
815843343SGabor Horvath   int i = 0;
915843343SGabor Horvath   [=] {
1015843343SGabor Horvath     int p = 5/i; // expected-warning{{Division by zero}}
1115843343SGabor Horvath     (void)p;
1215843343SGabor Horvath   }();
1315843343SGabor Horvath }
14