Debian Codegraph @

clang/test/Analysis/Checkers/WebKit/uncounted-obj-const-v-muable.cpp

raw
1 // RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
2
3 #include "mock-types.h"
4
5 class Object {
6 public:
7 void ref() const;
8 void deref() const;
9
10 bool constFunc() const;
11 void mutableFunc();
12 };
13
14 class Caller {
15 void someFunction();
16 void otherFunction();
17 private:
18 RefPtr<Object> m_obj;
19 };
20
21 void Caller::someFunction()
22 {
23 m_obj->constFunc();
24 // expected-warning@-1{{Call argument for 'this' parameter is uncounted and unsafe}}
25 m_obj->mutableFunc();
26 // expected-warning@-1{{Call argument for 'this' parameter is uncounted and unsafe}}
27 }