From b39e1ffd1165da044c513234f5776a9085b818aa Mon Sep 17 00:00:00 2001 From: Chinmay Shrivastava <67478015+JonSnow1807@users.noreply.github.com> Date: Sat, 7 Nov 2026 00:51:30 -0600 Subject: [PATCH] GH-55429: [C++] Avoid unavailable libc++ utilities in CRAN builds --- cpp/src/arrow/compute/kernels/codegen_internal.h | 5 ++--- cpp/src/parquet/column_reader.cc | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cpp/src/arrow/compute/kernels/codegen_internal.h b/cpp/src/arrow/compute/kernels/codegen_internal.h index 405f35a9234b..d1b3f3528c2f 100644 --- a/cpp/src/arrow/compute/kernels/codegen_internal.h +++ b/cpp/src/arrow/compute/kernels/codegen_internal.h @@ -17,7 +17,6 @@ #pragma once -#include #include #include #include @@ -1236,7 +1235,7 @@ struct GeneratorApplicator { template class Generator, typename... Args> - requires std::invocable + requires std::is_invocable_v auto GenerateKernelExecImpl(Type::type id) { constexpr auto kNumTypeIds = std::tuple_size_v; static_assert(ArrayIndex < kNumTypeIds); @@ -1272,7 +1271,7 @@ auto GenerateKernelExecImpl(Type::type id) { template class Generator, typename... Args> - requires std::invocable + requires std::is_invocable_v auto GenerateKernelExec(detail::GetTypeId get_id) { return detail::GenerateKernelExecImpl(get_id.id); diff --git a/cpp/src/parquet/column_reader.cc b/cpp/src/parquet/column_reader.cc index 6aca8a23ce16..b9621ee32864 100644 --- a/cpp/src/parquet/column_reader.cc +++ b/cpp/src/parquet/column_reader.cc @@ -85,8 +85,9 @@ inline void CheckNumberDecoded(int64_t number_decoded, int64_t expected) { /// True if a T can hold a U. template -inline constexpr bool can_hold_v = std::in_range(std::numeric_limits::min()) && - std::in_range(std::numeric_limits::max()); +inline constexpr bool can_hold_v = + std::numeric_limits::digits >= std::numeric_limits::digits && + (std::numeric_limits::is_signed || !std::numeric_limits::is_signed); /// Clamp to a given type. template