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 @@ -114,7 +114,7 @@ class UncountedLambdaCapturesChecker
if (!DRE)
return;
auto *MD = dyn_cast_or_null<CXXMethodDecl>(DRE->getDecl());
if (!MD || CE->getNumArgs() != 1)
if (!MD || CE->getNumArgs() < 1)
return;
auto *Arg = CE->getArg(0)->IgnoreParenCasts();
auto *ArgRef = dyn_cast<DeclRefExpr>(Arg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void noescape_lambda() {
}

void lambda_capture_param(RefCountable* obj) {
auto someLambda = [&] {
auto someLambda = [&]() {
obj->method();
};
someLambda();
Expand Down Expand Up @@ -178,3 +178,10 @@ void trivial_lambda() {
};
trivial_lambda();
}

void lambda_with_args(RefCountable* obj) {
auto trivial_lambda = [&](int v) {
obj->method();
};
trivial_lambda(1);
}
Loading