aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Analysis/issue-91835.cpp
blob: 9581bd86156b0578cbfc0ab7f4897e3746829fb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// RUN: %clang_analyze_cc1 -std=c++20 %s -analyzer-checker=core.NullDereference -analyzer-output=text -verify

// expected-no-diagnostics

struct S { int x; };

void f(int x) { (void)x; }

int main()
{
    S s{42};
    auto& [x] = s;
    auto g = [x](){ f(x); }; // no warning
    g();
}