Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ bool isASafeCallArg(const Expr *E) {
return true;
}
}
if (isa<CXXTemporaryObjectExpr>(E))
return true; // A temporary lives until the end of this statement.
if (isConstOwnerPtrMemberExpr(E))
return true;

Expand Down
5 changes: 5 additions & 0 deletions clang/test/Analysis/Checkers/WebKit/unchecked-call-arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ void foo() {
provide()->doWork();
// expected-warning@-1{{Call argument for 'this' parameter is unchecked and unsafe}}
}

void doWorkWithObject(const CheckedObject&);
void bar() {
doWorkWithObject(CheckedObject());
}