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