Skip to content

Commit dd47cd0

Browse files
kouassignUser
authored andcommitted
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]>
1 parent 458b6ab commit dd47cd0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cpp/src/arrow/compute/kernels/pivot_internal.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ Result<std::unique_ptr<PivotWiderKeyMapper>> PivotWiderKeyMapper::Make(
150150
const DataType& key_type, const PivotWiderOptions* options, ExecContext* ctx) {
151151
auto instance = std::make_unique<ConcretePivotWiderKeyMapper>();
152152
RETURN_NOT_OK(instance->Init(key_type, options, ctx));
153-
return instance;
153+
// We can remove this static_cast() once we drop support for g++
154+
// 7.5.0 (we require C++20).
155+
return static_cast<std::unique_ptr<PivotWiderKeyMapper>>(std::move(instance));
154156
}
155157

156158
} // namespace arrow::compute::internal

0 commit comments

Comments
 (0)