You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/11/20 17:22:40 UTC

[arrow] branch master updated: ARROW-3841: [C++] Suppress catching polymorphic type by value warning

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

wesm 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 0cc777f  ARROW-3841: [C++] Suppress catching polymorphic type by value warning
0cc777f is described below

commit 0cc777f57646fdb8a4f6c34fc4d3acad2c76ca72
Author: Kouhei Sutou <ko...@clear-code.com>
AuthorDate: Tue Nov 20 12:22:33 2018 -0500

    ARROW-3841: [C++] Suppress catching polymorphic type by value warning
    
        ../src/arrow/compute/compute-test.cc: In member function 'virtual void arrow::compute::TestCast_StringToNumber_Test::TestBody()':
        ../src/arrow/compute/compute-test.cc:917:17: warning: catching polymorphic type 'class std::runtime_error' by value [-Wcatch-value=]
           } catch (std::runtime_error) {
                         ^~~~~~~~~~~~~
    
    Author: Kouhei Sutou <ko...@clear-code.com>
    
    Closes #3003 from kou/master and squashes the following commits:
    
    d020eb94a <Kouhei Sutou>  Suppress catching polymorphic type by value warning
    ffe88b06d <Kouhei Sutou>  Suppress catching polymorphic type by value warning
---
 cpp/src/arrow/compute/compute-test.cc   | 2 +-
 cpp/src/arrow/util/parsing-util-test.cc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpp/src/arrow/compute/compute-test.cc b/cpp/src/arrow/compute/compute-test.cc
index 8da3408..505dfed 100644
--- a/cpp/src/arrow/compute/compute-test.cc
+++ b/cpp/src/arrow/compute/compute-test.cc
@@ -914,7 +914,7 @@ TEST_F(TestCast, StringToNumber) {
   try {
     // French locale uses the comma as decimal point
     std::locale::global(std::locale("fr_FR.UTF-8"));
-  } catch (std::runtime_error) {
+  } catch (std::runtime_error&) {
     // Locale unavailable, ignore
   }
   CheckCase<StringType, std::string, FloatType, float>(utf8(), v_float, is_valid,
diff --git a/cpp/src/arrow/util/parsing-util-test.cc b/cpp/src/arrow/util/parsing-util-test.cc
index 7637a71..dd7718d 100644
--- a/cpp/src/arrow/util/parsing-util-test.cc
+++ b/cpp/src/arrow/util/parsing-util-test.cc
@@ -48,7 +48,7 @@ class LocaleGuard {
   explicit LocaleGuard(const char* new_locale) : global_locale_(std::locale()) {
     try {
       std::locale::global(std::locale(new_locale));
-    } catch (std::runtime_error) {
+    } catch (std::runtime_error&) {
       // Locale unavailable, ignore
     }
   }