1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2 // expected-no-diagnostics
4 template <typename
... Ts
>
8 int strange(Dummy param
) {
9 Dummy local_pre_lambda
;
12 // LambdaExpr is modeled as lazyCompoundVal of tempRegion, that contains
13 // all captures. In this instance, this region contains a pointer/reference
14 // to ref_captured variable.
16 escape(param
, local_pre_lambda
);
17 return ref_captured
; // no-warning: The value is not garbage.
20 int local_defined_after_lambda
; // Unused, but necessary! Important that it's before the call.
22 // The ref_captured binding should not be pruned at this point, as it is still
23 // accessed via reference captured in operator() of fn.