Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-17567: [C++] Avoid internal compiler error with gcc 7 and c++17 #14004

Merged
merged 4 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cpp/src/arrow/compute/kernels/aggregate_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ enable_if_t<std::is_floating_point<SumType>::value, SumType> SumArray(

// reduce summation of one block (may be smaller than kBlockSize) from leaf node
// continue reducing to upper level if two summations are ready for non-leaf node
auto reduce = [&](SumType block_sum) {
// (capture `levels` by value because of ARROW-17567)
auto reduce = [&, levels](SumType block_sum) {
pitrou marked this conversation as resolved.
Show resolved Hide resolved
int cur_level = 0;
uint64_t cur_level_mask = 1ULL;
sum[cur_level] += block_sum;
Expand Down
13 changes: 9 additions & 4 deletions cpp/src/arrow/compute/kernels/scalar_set_lookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ struct SetLookupState : public KernelState {
auto visit_valid = [&](T v) {
const auto memo_size = static_cast<int32_t>(memo_index_to_value_index.size());
int32_t unused_memo_index;
auto on_found = [&](int32_t memo_index) { DCHECK_LT(memo_index, memo_size); };
auto on_not_found = [&](int32_t memo_index) {
// (capture `memo_index` by value because of ARROW-17567
js8544 marked this conversation as resolved.
Show resolved Hide resolved
auto on_found = [&, memo_size](int32_t memo_index) {
pitrou marked this conversation as resolved.
Show resolved Hide resolved
DCHECK_LT(memo_index, memo_size);
};
auto on_not_found = [&, memo_size](int32_t memo_index) {
DCHECK_EQ(memo_index, memo_size);
memo_index_to_value_index.push_back(index);
};
Expand All @@ -79,8 +82,10 @@ struct SetLookupState : public KernelState {
};
auto visit_null = [&]() {
const auto memo_size = static_cast<int32_t>(memo_index_to_value_index.size());
auto on_found = [&](int32_t memo_index) { DCHECK_LT(memo_index, memo_size); };
auto on_not_found = [&](int32_t memo_index) {
auto on_found = [&, memo_size](int32_t memo_index) {
DCHECK_LT(memo_index, memo_size);
};
auto on_not_found = [&, memo_size](int32_t memo_index) {
DCHECK_EQ(memo_index, memo_size);
memo_index_to_value_index.push_back(index);
};
Expand Down