brintos

brintos / llvm-project-archived public Read only

0
0
Text · 288 B · 9581bd8 Raw
16 lines · cpp
1// RUN: %clang_analyze_cc1 -std=c++20 %s -analyzer-checker=core.NullDereference -analyzer-output=text -verify2 3// expected-no-diagnostics4 5struct S { int x; };6 7void f(int x) { (void)x; }8 9int main()10{11    S s{42};12    auto& [x] = s;13    auto g = [x](){ f(x); }; // no warning14    g();15}16