Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,11 @@ class RawPtrRefLambdaCapturesChecker
if (!Init)
return nullptr;
if (auto *Lambda = dyn_cast<LambdaExpr>(Init)) {
DeclRefExprsToIgnore.insert(DRE);
updateIgnoreList();
return Lambda;
}
TempExpr = dyn_cast<CXXBindTemporaryExpr>(Init->IgnoreParenCasts());
if (!TempExpr)
return nullptr;
updateIgnoreList();
return dyn_cast_or_null<LambdaExpr>(TempExpr->getSubExpr());
return nullptr;
}

void checkCalleeLambda(CallExpr *CE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,4 +448,27 @@ void ranges_for_each(RefCountable* obj) {
obj->method();
++(*static_cast<unsigned*>(item));
});
}
}

class RefCountedObj {
public:
void ref();
void deref();

void call() const;
void callLambda([[clang::noescape]] const WTF::Function<void ()>& callback) const;
void doSomeWork() const;
};

void RefCountedObj::callLambda([[clang::noescape]] const WTF::Function<void ()>& callback) const
{
callback();
}

void RefCountedObj::call() const
{
auto lambda = [&] {
doSomeWork();
};
callLambda(lambda);
}