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 8a8d7ce ARROW-9512: [C++] Avoid variadic template unpack inside
lambda to work around gcc 4.8 bug
8a8d7ce is described below
commit 8a8d7ce39793ed8cafb2318c2752f027c75a17e6
Author: Wes McKinney <[email protected]>
AuthorDate: Sun Jul 19 12:25:20 2020 -0500
ARROW-9512: [C++] Avoid variadic template unpack inside lambda to work
around gcc 4.8 bug
This works around a gcc bug. This only affects compilation of unit tests on
gcc 4.8 so not an issue for the 1.0.0 RC1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47226
Closes #7794 from wesm/ARROW-9512
Authored-by: Wes McKinney <[email protected]>
Signed-off-by: Wes McKinney <[email protected]>
---
cpp/src/arrow/testing/gtest_util.cc | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/cpp/src/arrow/testing/gtest_util.cc
b/cpp/src/arrow/testing/gtest_util.cc
index de5b87a..b2f5566 100644
--- a/cpp/src/arrow/testing/gtest_util.cc
+++ b/cpp/src/arrow/testing/gtest_util.cc
@@ -106,20 +106,6 @@ void AssertTsSame(const T& expected, const T& actual,
CompareFunctor&& compare)
}
}
-template <typename T, typename... ExtraArgs>
-void AssertTsEqual(const T& expected, const T& actual, ExtraArgs... args) {
- return AssertTsSame(expected, actual, [&](const T& expected, const T&
actual) {
- return expected.Equals(actual, args...);
- });
-}
-
-template <typename T>
-void AssertTsApproxEqual(const T& expected, const T& actual) {
- return AssertTsSame(expected, actual, [](const T& expected, const T& actual)
{
- return expected.ApproxEquals(actual);
- });
-}
-
template <typename CompareFunctor>
void AssertArraysEqualWith(const Array& expected, const Array& actual, bool
verbose,
CompareFunctor&& compare) {
@@ -175,11 +161,17 @@ void AssertScalarsEqual(const Scalar& expected, const
Scalar& actual, bool verbo
void AssertBatchesEqual(const RecordBatch& expected, const RecordBatch& actual,
bool check_metadata) {
- AssertTsEqual(expected, actual, check_metadata);
+ AssertTsSame(expected, actual,
+ [&](const RecordBatch& expected, const RecordBatch& actual) {
+ return expected.Equals(actual, check_metadata);
+ });
}
void AssertBatchesApproxEqual(const RecordBatch& expected, const RecordBatch&
actual) {
- AssertTsApproxEqual(expected, actual);
+ AssertTsSame(expected, actual,
+ [&](const RecordBatch& expected, const RecordBatch& actual) {
+ return expected.ApproxEquals(actual);
+ });
}
void AssertChunkedEqual(const ChunkedArray& expected, const ChunkedArray&
actual) {