Skip to content

Commit

Permalink
Fixing errors reported by clang-tidy after merging master
Browse files Browse the repository at this point in the history
This patch fixes problems reported by clang-tidy after enabling the following
checks:
    modernize-use-nullptr
    misc-use-after-move
    misc-virtual-near-miss
    misc-multiple-statement-macro
    misc-move-constructor-init
    misc-move-forwarding-reference
    misc-assert-side-effect
    misc-dangling-handle
    misc-move-constructor-init
    misc-move-forwarding-reference
    misc-non-copyable-objects
    misc-forwarding-reference-overload
  • Loading branch information
Thomas Heller committed Nov 30, 2017
1 parent 1642e77 commit 01f899a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions hpx/lcos/local/packaged_continuation.hpp
Expand Up @@ -80,7 +80,7 @@ namespace hpx { namespace lcos { namespace detail
std::false_type)
{
try {
cont.set_value(func(std::move(future)));
cont.set_value(func(std::forward<Future>(future)));
}
catch (...) {
cont.set_exception(std::current_exception());
Expand All @@ -92,7 +92,7 @@ namespace hpx { namespace lcos { namespace detail
std::true_type)
{
try {
func(std::move(future));
func(std::forward<Future>(future));
cont.set_value(util::unused);
}
catch (...) {
Expand All @@ -112,7 +112,7 @@ namespace hpx { namespace lcos { namespace detail
> is_void;

hpx::util::annotate_function annotate(func);
invoke_continuation(func, std::move(future), cont, is_void());
invoke_continuation(func, std::forward<Future>(future), cont, is_void());
}

template <typename Func, typename Future, typename Continuation>
Expand All @@ -132,7 +132,7 @@ namespace hpx { namespace lcos { namespace detail

// take by value, as the future may go away immediately
inner_shared_state_ptr inner_state =
traits::detail::get_shared_state(func(std::move(future)));
traits::detail::get_shared_state(func(std::forward<Future>(future)));
typename inner_shared_state_ptr::element_type* ptr =
inner_state.get();

Expand Down Expand Up @@ -853,7 +853,7 @@ namespace hpx { namespace lcos { namespace detail
// create a continuation
typename traits::detail::shared_state_ptr<result_type>::type p(
new shared_state(init_no_addref()), false);
static_cast<shared_state*>(p.get())->attach(std::move(future));
static_cast<shared_state*>(p.get())->attach(std::forward<Future>(future));
return p;
}
}}}
Expand Down
8 changes: 4 additions & 4 deletions hpx/parallel/algorithms/merge.hpp
Expand Up @@ -586,8 +586,8 @@ namespace hpx { namespace parallel { inline namespace v1
// Not reachable.
HPX_ASSERT(false);
}

fut.get();
if (fut.valid()) // NOLINT
fut.get();
}
else /* left_size < right_size */
{
Expand Down Expand Up @@ -640,8 +640,8 @@ namespace hpx { namespace parallel { inline namespace v1
// Not reachable.
HPX_ASSERT(false);
}

fut.get();
if (fut.valid()) // NOLINT
fut.get();
}
}

Expand Down
2 changes: 1 addition & 1 deletion tools/clang-tidy.sh
Expand Up @@ -89,7 +89,7 @@ CHECKS="$CHECKS,misc-forwarding-reference-overload"
i=1
for file in $FILES
do
which bc
which bc > /dev/null
if [[ $? == 0 ]]
then
percentage=$(echo "scale=2; ${i}/${NUM_FILES} * 100" | bc | cut -d '.' -f 1)
Expand Down

0 comments on commit 01f899a

Please sign in to comment.