Skip to content

Commit fa77995

Browse files
committed
Fix local-vars-counted-const-member.cpp by adding a copy assignment to mock RefPtr.
1 parent 89004f9 commit fa77995

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

clang/test/Analysis/Checkers/WebKit/mock-types.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,17 @@ template <typename T> struct RefPtr {
105105
RefPtr(const RefPtr& o)
106106
: t(o.t)
107107
{
108-
if (t)
109-
t->ref();
108+
if (t)
109+
t->ref();
110+
}
111+
RefPtr operator=(const RefPtr& o)
112+
{
113+
if (t)
114+
t->deref();
115+
t = o.t;
116+
if (t)
117+
t->ref();
118+
return *this;
110119
}
111120
~RefPtr() {
112121
if (t)

0 commit comments

Comments
 (0)