Skip to content

Commit 2db4638

Browse files
author
segoon
committed
feat clang-tidy: honour structured bindings in taxi-async-use-after-free
commit_hash:684af596be7ec6b286cb64d628fff2ccece7c99f
1 parent d6b0350 commit 2db4638

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ynd/clang-tidy/18/checks/taxi_async_use_after_free_check.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ void TaxiAsyncUseAfterFreeCheck::check(const MatchFinder::MatchResult& Result) {
5252
if (CapturedVarDecl->getType().getCanonicalType()->isLValueReferenceType()) continue;
5353
if (CapturedVarDecl->getType().getCanonicalType()->isRValueReferenceType()) continue;
5454

55+
if (const auto* BD = llvm::dyn_cast<BindingDecl>(CapturedVarDecl)) {
56+
continue;
57+
}
58+
5559
if (CapturedVarDecl->getLocation() >= TasksLocation) {
5660
diag(Capture.getLocation(), "variable can be used after free");
5761
diag(CapturedVarDecl->getLocation(), "variable was declared here", DiagnosticIDs::Level::Note);

0 commit comments

Comments
 (0)