Skip to content

Commit

Permalink
Add bugprone-move-forwarding-reference check to clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
phate committed Dec 21, 2024
1 parent 4821290 commit 91e6816
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
Checks: '-*,
bugprone-move-forwarding-reference,
modernize-deprecated-headers,
modernize-redundant-void-arg,
'

WarningsAsErrors: '
bugprone-move-forwarding-reference,
modernize-deprecated-headers,
modernize-redundant-void-arg,
'
6 changes: 3 additions & 3 deletions jlm/rvsdg/reduction-helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pairwise_reduce(Container && args, const Reductor & reductor)
{
if (args.empty())
{
return std::move(args);
return std::forward(args);
}

auto left = args.begin();
Expand All @@ -75,7 +75,7 @@ pairwise_reduce(Container && args, const Reductor & reductor)
}
args.erase(std::next(left), args.end());

return std::move(args);
return std::forward(args);
}

/* Test whether any pair of elements of "args" can be reduced according
Expand Down Expand Up @@ -137,7 +137,7 @@ commutative_pairwise_reduce(Container && args, const Reductor & reductor)
++left;
}

return std::move(args);
return std::forward(args);
}

/* Test whether "flatten_tester" applies to any element of "args". */
Expand Down

0 comments on commit 91e6816

Please sign in to comment.