brintos

brintos / llvm-project-archived public Read only

0
0
Text · 760 B · a1860a5 Raw
26 lines · cpp
1// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s2 3#include "mock-types.h"4 5class Obj {6public:7  static Obj* get();8  static RefPtr<Obj> create();9  void ref() const;10  void deref() const;11};12 13void someFunction(Obj*, Obj* = nullptr);14void otherFunction(Obj*, Obj* = Obj::get());15// expected-warning@-1{{Call argument is uncounted and unsafe [alpha.webkit.UncountedCallArgsChecker]}}16void anotherFunction(Obj*, Obj* = Obj::create().get());17 18void otherFunction() {19  someFunction(nullptr);20  someFunction(Obj::get());21  // expected-warning@-1{{Call argument is uncounted and unsafe [alpha.webkit.UncountedCallArgsChecker]}}22  someFunction(Obj::create().get());23  otherFunction(nullptr);24  anotherFunction(nullptr);25}26