1 // RUN: %clang_analyze_cc1 -fblocks -analyzer-checker core,unix -verify %s
4 typedef struct once_flag_s
{
8 template <class Callable
, class... Args
>
9 void call_once(once_flag
&o
, Callable
&& func
, Args
&&... args
);
12 typedef __typeof(sizeof(int)) size_t;
17 void test_no_state_change_in_body_farm() {
19 call_once(flag
, callee
); // no-crash
21 } // expected-warning{{Potential memory leak}}
23 void test_no_state_change_in_body_farm_2() {
26 call_once(flag
, callee
); // no-crash
28 } // expected-warning{{Potential leak of memory pointed to by 'p'}}