1 #define MOZ_NO_ADDREF_RELEASE_ON_RETURN __attribute__((annotate("moz_no_addref_release_on_return")))
9 struct TestD
: Test
{};
12 Test
* f() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
13 Test
& g() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
14 Test
h() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
18 TestD
* f() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
19 TestD
& g() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
20 TestD
h() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
25 T
* f() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
26 T
& g() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
27 T
h() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
32 T
* operator->() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
35 Test
* f() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
36 Test
& g() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
37 Test
h() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
39 TestD
* fd() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
40 TestD
& gd() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
41 TestD
hd() MOZ_NO_ADDREF_RELEASE_ON_RETURN
;
45 s
.f()->AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'f'}}
46 s
.f()->Release(); // expected-error{{'Release' cannot be called on the return value of 'f'}}
48 s
.g().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'g'}}
49 s
.g().Release(); // expected-error{{'Release' cannot be called on the return value of 'g'}}
51 s
.h().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'h'}}
52 s
.h().Release(); // expected-error{{'Release' cannot be called on the return value of 'h'}}
55 sd
.f()->AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'f'}}
56 sd
.f()->Release(); // expected-error{{'Release' cannot be called on the return value of 'f'}}
58 sd
.g().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'g'}}
59 sd
.g().Release(); // expected-error{{'Release' cannot be called on the return value of 'g'}}
61 sd
.h().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'h'}}
62 sd
.h().Release(); // expected-error{{'Release' cannot be called on the return value of 'h'}}
65 x
.f()->AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'f'}}
66 x
.f()->Release(); // expected-error{{'Release' cannot be called on the return value of 'f'}}
68 x
.g().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'g'}}
69 x
.g().Release(); // expected-error{{'Release' cannot be called on the return value of 'g'}}
71 x
.h().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'h'}}
72 x
.h().Release(); // expected-error{{'Release' cannot be called on the return value of 'h'}}
75 xd
.f()->AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'f'}}
76 xd
.f()->Release(); // expected-error{{'Release' cannot be called on the return value of 'f'}}
78 xd
.g().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'g'}}
79 xd
.g().Release(); // expected-error{{'Release' cannot be called on the return value of 'g'}}
81 xd
.h().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'h'}}
82 xd
.h().Release(); // expected-error{{'Release' cannot be called on the return value of 'h'}}
85 sp
->AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'operator->'}}
86 sp
->Release(); // expected-error{{'Release' cannot be called on the return value of 'operator->'}}
89 spd
->AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'operator->'}}
90 spd
->Release(); // expected-error{{'Release' cannot be called on the return value of 'operator->'}}
92 f()->AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'f'}}
93 f()->Release(); // expected-error{{'Release' cannot be called on the return value of 'f'}}
95 g().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'g'}}
96 g().Release(); // expected-error{{'Release' cannot be called on the return value of 'g'}}
98 h().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'h'}}
99 h().Release(); // expected-error{{'Release' cannot be called on the return value of 'h'}}
101 fd()->AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'fd'}}
102 fd()->Release(); // expected-error{{'Release' cannot be called on the return value of 'fd'}}
104 gd().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'gd'}}
105 gd().Release(); // expected-error{{'Release' cannot be called on the return value of 'gd'}}
107 hd().AddRef(); // expected-error{{'AddRef' cannot be called on the return value of 'hd'}}
108 hd().Release(); // expected-error{{'Release' cannot be called on the return value of 'hd'}}