brintos

brintos / llvm-project-archived public Read only

0
0
Text · 607 B · 2721cd8 Raw
28 lines · cpp
1// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s2 3#include "mock-types.h"4 5class Object {6public:7    void ref() const;8    void deref() const;9 10    bool constFunc() const;11    void mutableFunc();12};13 14class Caller {15  void someFunction();16  void otherFunction();17private:18    RefPtr<Object> m_obj;19};20 21void 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}28