[clang-tools-extra] [clang-tidy] Fix performance-move-const-arg false negative in ternary… (PR #128402)
Congcong Cai via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 23 02:51:00 PST 2025
================
@@ -44,6 +44,12 @@ void MoveConstArgCheck::registerMatchers(MatchFinder *Finder) {
unless(isInTemplateInstantiation()))
.bind("call-move");
+ // Match ternary expressions where either branch contains std::move
+ auto TernaryWithMoveMatcher =
+ conditionalOperator(
+ hasDescendant(MoveCallMatcher)
+ ).bind("ternary-move");
----------------
HerrCai0907 wrote:
```suggestion
);
```
bind isonly needed when you want to use it later.
https://github.com/llvm/llvm-project/pull/128402
More information about the cfe-commits
mailing list