Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bugprone-move-forwarding-reference check to clang-tidy #695

Merged
merged 10 commits into from
Jan 4, 2025
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,
'
10 changes: 5 additions & 5 deletions jlm/rvsdg/reduction-helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
#ifndef JLM_RVSDG_REDUCTION_HELPERS_HPP
#define JLM_RVSDG_REDUCTION_HELPERS_HPP

#include <algorithm>

#include <jlm/rvsdg/node.hpp>

#include <algorithm>

namespace jlm::rvsdg
{
namespace base
Expand Down Expand Up @@ -52,7 +52,7 @@ pairwise_reduce(Container && args, const Reductor & reductor)
{
haved marked this conversation as resolved.
Show resolved Hide resolved
if (args.empty())
{
return std::move(args);
return std::forward<Container>(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<Container>(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<Container>(args);
}

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