[ORC] Fail materialization in tasks that are destroyed before running.
[llvm-project.git] / clang / test / Analysis / Checkers / WebKit / uncounted-obj-arg.mm
blob9ad1880e9d11883ff1ece51a89d086704244860a
1 // RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
2 // expected-no-diagnostics
4 #import "mock-types.h"
5 #import "mock-system-header.h"
6 #import "../../Inputs/system-header-simulator-for-objc-dealloc.h"
8 @interface Foo : NSObject
10 @property (nonatomic, readonly) RefPtr<RefCountable> countable;
12 - (void)execute;
13 - (RefPtr<RefCountable>)_protectedRefCountable;
14 @end
16 @implementation Foo
18 - (void)execute {
19   self._protectedRefCountable->method();
22 - (RefPtr<RefCountable>)_protectedRefCountable {
23   return _countable;
26 @end
28 class RefCountedObject {
29 public:
30   void ref() const;
31   void deref() const;
32   Ref<RefCountedObject> copy() const;
35 @interface WrapperObj : NSObject
37 - (Ref<RefCountedObject>)_protectedWebExtensionControllerConfiguration;
39 @end
41 static void foo(WrapperObj *configuration) {
42   configuration._protectedWebExtensionControllerConfiguration->copy();