llvm-project
2186dca2 - [clang-tidy] Fix FP in cppcoreguidelines-missing-std-forward in lambda init-list (#190522)

Commit
128 days ago
[clang-tidy] Fix FP in cppcoreguidelines-missing-std-forward in lambda init-list (#190522) In `TK_IgnoreUnlessSpelledInSource` mode [`MatchChildASTVisitor::TraverseLambdaExpr`](https://github.com/llvm/llvm-project/blob/main/clang/lib/ASTMatchers/ASTMatchFinder.cpp#L280) only calls `match()` on each capture-init expression without recursing into its children. So for `[t{std::forward<T>(t)}]` the `CallExpr` nested inside the `InitListExpr` is never visited, and `ForwardCallMatcher` never binds "call". Fixes https://github.com/llvm/llvm-project/issues/150446.
Author
Parents
Loading