Skip to content

Commit ed5eacd

Browse files
committed
Add a test case for ivar resulting in a warning
1 parent b3d79dd commit ed5eacd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/test/Analysis/Checkers/WebKit/uncounted-obj-arg.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
2-
// expected-no-diagnostics
32

43
#import "mock-types.h"
54
#import "mock-system-header.h"
@@ -8,6 +7,7 @@
87
@interface Foo : NSObject {
98
const Ref<RefCountable> _obj1;
109
const RefPtr<RefCountable> _obj2;
10+
Ref<RefCountable> _obj3;
1111
}
1212

1313
@property (nonatomic, readonly) RefPtr<RefCountable> countable;
@@ -23,6 +23,8 @@ - (void)execute {
2323
_obj1->method();
2424
_obj1.get().method();
2525
(*_obj2).method();
26+
_obj3->method();
27+
// expected-warning@-1{{Call argument for 'this' parameter is uncounted and unsafe}}
2628
}
2729

2830
- (RefPtr<RefCountable>)_protectedRefCountable {

0 commit comments

Comments
 (0)