1 // RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
2 // expected-no-diagnostics
4 #include "mock-types.h"
6 template <typename T
> struct RefAllowingPartiallyDestroyed
{
9 RefAllowingPartiallyDestroyed() : t
{} {};
10 RefAllowingPartiallyDestroyed(T
&) {}
11 T
*get() { return t
; }
12 T
*ptr() { return t
; }
13 T
*operator->() { return t
; }
14 operator const T
&() const { return *t
; }
15 operator T
&() { return *t
; }
18 template <typename T
> struct RefPtrAllowingPartiallyDestroyed
{
21 RefPtrAllowingPartiallyDestroyed() : t(new T
) {}
22 RefPtrAllowingPartiallyDestroyed(T
*t
) : t(t
) {}
23 T
*get() { return t
; }
24 T
*operator->() { return t
; }
25 const T
*operator->() const { return t
; }
26 T
&operator*() { return *t
; }
27 RefPtrAllowingPartiallyDestroyed
&operator=(T
*) { return *this; }
28 operator bool() { return t
; }
38 RefAllowingPartiallyDestroyed
<RefCounted
> object1();
39 RefPtrAllowingPartiallyDestroyed
<RefCounted
> object2();
42 object1()->someFunction();
43 object2()->someFunction();