diff --git a/cpp/src/arrow/dataset/expression.cc b/cpp/src/arrow/dataset/expression.cc index e7acac3600b88..16f706ed1a46d 100644 --- a/cpp/src/arrow/dataset/expression.cc +++ b/cpp/src/arrow/dataset/expression.cc @@ -681,7 +681,7 @@ Result FoldConstants(Expression expr) { if (std::all_of(call->arguments.begin(), call->arguments.end(), [](const Expression& argument) { return argument.literal(); })) { // all arguments are literal; we can evaluate this subexpression *now* - static const Datum ignored_input; + static const Datum ignored_input = Datum{}; ARROW_ASSIGN_OR_RAISE(Datum constant, ExecuteScalarExpression(expr, ignored_input)); diff --git a/cpp/src/arrow/util/future.h b/cpp/src/arrow/util/future.h index 60ce71cd153d0..2fc040c2e2fa5 100644 --- a/cpp/src/arrow/util/future.h +++ b/cpp/src/arrow/util/future.h @@ -54,7 +54,7 @@ struct is_future> : std::true_type {}; template using result_of_t = typename std::result_of::type; -constexpr struct ContinueFuture { +struct ContinueFuture { template struct ForReturnImpl; @@ -99,7 +99,7 @@ constexpr struct ContinueFuture { signal_to_complete_next.AddCallback(MarkNextFinished{std::move(next)}); } -} Continue; +}; template <> struct ContinueFuture::ForReturnImpl { @@ -438,13 +438,14 @@ class ARROW_MUST_USE_TYPE Future { struct Callback { void operator()(const Result& result) && { + detail::ContinueFuture continue_future; if (ARROW_PREDICT_TRUE(result.ok())) { // move on_failure to a(n immediately destroyed) temporary to free its resources ARROW_UNUSED(OnFailure(std::move(on_failure))); - detail::Continue(std::move(next), std::move(on_success), result.ValueOrDie()); + continue_future(std::move(next), std::move(on_success), result.ValueOrDie()); } else { ARROW_UNUSED(OnSuccess(std::move(on_success))); - detail::Continue(std::move(next), std::move(on_failure), result.status()); + continue_future(std::move(next), std::move(on_failure), result.status()); } } diff --git a/cpp/src/arrow/util/thread_pool.h b/cpp/src/arrow/util/thread_pool.h index fb326f4ec21e7..3b611435d06dd 100644 --- a/cpp/src/arrow/util/thread_pool.h +++ b/cpp/src/arrow/util/thread_pool.h @@ -95,8 +95,8 @@ class ARROW_EXPORT Executor { Result Submit(TaskHints hints, Function&& func, Args&&... args) { auto future = FutureType::Make(); - auto task = std::bind(::arrow::detail::Continue, future, std::forward(func), - std::forward(args)...); + auto task = std::bind(::arrow::detail::ContinueFuture{}, future, + std::forward(func), std::forward(args)...); ARROW_RETURN_NOT_OK(SpawnReal(hints, std::move(task))); return future;