This is an automated email from the ASF dual-hosted git repository.

assignuser pushed a commit to branch maint-20.0.0
in repository https://gitbox.apache.org/repos/asf/arrow.git

commit dd47cd0cc197475587cba9ff854b5ca0c278bfa5
Author: Sutou Kouhei <[email protected]>
AuthorDate: Mon Apr 7 09:30:10 2025 +0900

    GH-46022: [C++] Fix build error with g++ 7.5.0 (#46028)
    
    ### Rationale for this change
    
    We need explicit upcast for `std::unique_ptr<>` with g++ 7.5.0.
    
    ### What changes are included in this PR?
    
    Add explicit upcast.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    Yes.
    * GitHub Issue: #46022
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/arrow/compute/kernels/pivot_internal.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cpp/src/arrow/compute/kernels/pivot_internal.cc 
b/cpp/src/arrow/compute/kernels/pivot_internal.cc
index 72d96213c9..ee104919d5 100644
--- a/cpp/src/arrow/compute/kernels/pivot_internal.cc
+++ b/cpp/src/arrow/compute/kernels/pivot_internal.cc
@@ -150,7 +150,9 @@ Result<std::unique_ptr<PivotWiderKeyMapper>> 
PivotWiderKeyMapper::Make(
     const DataType& key_type, const PivotWiderOptions* options, ExecContext* 
ctx) {
   auto instance = std::make_unique<ConcretePivotWiderKeyMapper>();
   RETURN_NOT_OK(instance->Init(key_type, options, ctx));
-  return instance;
+  // We can remove this static_cast() once we drop support for g++
+  // 7.5.0 (we require C++20).
+  return 
static_cast<std::unique_ptr<PivotWiderKeyMapper>>(std::move(instance));
 }
 
 }  // namespace arrow::compute::internal

Reply via email to