================
@@ -440,3 +440,45 @@ namespace call_with_adopt_ref {
adoptRef(new Obj)->method();
}
}
+
+namespace call_on_member {
+
+ class SomeObj {
+ public:
+ static Ref<SomeObj> create() { return adoptRef(*new SomeObj); }
+
+ void ref() const;
+ void deref() const;
+
+ void doWork() {
+ m_obj->method();
+ // expected-warning@-1{{Call argument for 'this' parameter is uncounted
and unsafe}}
+ m_obj.get()->method();
+ // expected-warning@-1{{Call argument for 'this' parameter is uncounted
and unsafe}}
+ m_constObj->method();
----------------
rniwa wrote:
That's a good point. I haven't seen that coming up in WebKit often though
probably because we don't use `const` function all that often.
https://github.com/llvm/llvm-project/pull/184243
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits