File tree 2 files changed +14
-0
lines changed
lib/StaticAnalyzer/Checkers/WebKit
test/Analysis/Checkers/WebKit
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,13 @@ bool tryToFindPtrOrigin(
28
28
E = tempExpr->getSubExpr ();
29
29
continue ;
30
30
}
31
+ if (auto *tempExpr = dyn_cast<CXXTemporaryObjectExpr>(E)) {
32
+ if (auto *C = tempExpr->getConstructor ()) {
33
+ if (auto *Class = C->getParent (); Class && isRefCounted (Class))
34
+ return callback (E, true );
35
+ break ;
36
+ }
37
+ }
31
38
if (auto *tempExpr = dyn_cast<ParenExpr>(E)) {
32
39
E = tempExpr->getSubExpr ();
33
40
continue ;
Original file line number Diff line number Diff line change @@ -358,3 +358,10 @@ namespace call_with_ptr_on_ref {
358
358
// expected-warning@-1{{Call argument for parameter 'bad' is uncounted and unsafe}}
359
359
}
360
360
}
361
+
362
+ namespace call_with_explicit_temporary_obj {
363
+ void foo () {
364
+ Ref { *provide () }->method ();
365
+ RefPtr { provide () }->method ();
366
+ }
367
+ }
You can’t perform that action at this time.
0 commit comments