clang/test/Analysis/issue-91835.cpp
raw| 1 | // RUN: %clang_analyze_cc1 -std=c++20 %s -analyzer-checker=core.NullDereference -analyzer-output=text -verify |
| 2 | |
| 3 | // expected-no-diagnostics |
| 4 | |
| 5 | struct S { int x; }; |
| 6 | |
| 7 | void f(int x) { (void)x; } |
| 8 | |
| 9 | int main() |
| 10 | { |
| 11 | S s{42}; |
| 12 | auto& [x] = s; |
| 13 | auto g = [x](){ f(x); }; // no warning |
| 14 | g(); |
| 15 | } |