You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2022/04/16 07:47:35 UTC

[arrow] branch master updated: ARROW-16205: [C++][FlightRPC] Don't use constexpr std::initializer_list

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

kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 83dda5c312 ARROW-16205: [C++][FlightRPC] Don't use constexpr std::initializer_list
83dda5c312 is described below

commit 83dda5c312238a2ce6e4d553e689444a8f665606
Author: David Li <li...@gmail.com>
AuthorDate: Sat Apr 16 16:47:20 2022 +0900

    ARROW-16205: [C++][FlightRPC] Don't use constexpr std::initializer_list
    
    To fix a build error on Clang.
    
    Closes #12903 from lidavidm/arrow-16205
    
    Authored-by: David Li <li...@gmail.com>
    Signed-off-by: Sutou Kouhei <ko...@clear-code.com>
---
 cpp/src/arrow/flight/test_definitions.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cpp/src/arrow/flight/test_definitions.cc b/cpp/src/arrow/flight/test_definitions.cc
index a152c3c960..fbe23b789d 100644
--- a/cpp/src/arrow/flight/test_definitions.cc
+++ b/cpp/src/arrow/flight/test_definitions.cc
@@ -1367,7 +1367,7 @@ void CudaDataTest::TestDoExchange() {
 // Test error handling
 
 namespace {
-constexpr std::initializer_list<StatusCode> kStatusCodes = {
+static const std::vector<StatusCode> kStatusCodes = {
     StatusCode::OutOfMemory,
     StatusCode::KeyError,
     StatusCode::TypeError,
@@ -1386,12 +1386,13 @@ constexpr std::initializer_list<StatusCode> kStatusCodes = {
     StatusCode::AlreadyExists,
 };
 
-constexpr std::initializer_list<FlightStatusCode> kFlightStatusCodes = {
+static const std::vector<FlightStatusCode> kFlightStatusCodes = {
     FlightStatusCode::Internal,     FlightStatusCode::TimedOut,
     FlightStatusCode::Cancelled,    FlightStatusCode::Unauthenticated,
     FlightStatusCode::Unauthorized, FlightStatusCode::Unavailable,
     FlightStatusCode::Failed,
 };
+
 arrow::Result<StatusCode> TryConvertStatusCode(int raw_code) {
   for (const auto status_code : kStatusCodes) {
     if (raw_code == static_cast<int>(status_code)) {