1 // RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
3 #include "mock-types.h"
5 RefCountableAndCheckable
* makeObj();
6 CheckedRef
<RefCountableAndCheckable
> makeObjChecked();
7 void someFunction(RefCountableAndCheckable
*);
9 namespace call_args_unchecked_uncounted
{
12 someFunction(makeObj());
13 // expected-warning@-1{{Call argument is uncounted and unsafe [alpha.webkit.UncountedCallArgsChecker]}}
16 } // namespace call_args_checked
18 namespace call_args_checked
{
21 CheckedPtr
<RefCountableAndCheckable
> ptr
= makeObj();
22 someFunction(ptr
.get());
26 someFunction(CheckedPtr
{ makeObj() }.get());
30 someFunction(makeObjChecked().ptr());
33 } // namespace call_args_checked
35 namespace call_args_default
{
37 void someFunction(RefCountableAndCheckable
* = makeObj());
38 // expected-warning@-1{{Call argument is uncounted and unsafe [alpha.webkit.UncountedCallArgsChecker]}}
39 void otherFunction(RefCountableAndCheckable
* = makeObjChecked().ptr());