You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/08/30 12:06:15 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #14004: ARROW-17567: [C++] Avoid internal compiler error with gcc 7 and c++17

pitrou commented on code in PR #14004:
URL: https://github.com/apache/arrow/pull/14004#discussion_r958393565


##########
cpp/src/arrow/compute/kernels/aggregate_internal.h:
##########
@@ -164,7 +164,7 @@ 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) {
+  auto reduce = [&, levels](SumType block_sum) {

Review Comment:
   ```suggestion
     // (capture `levels` by value because of ARROW-17567)
     auto reduce = [&, levels](SumType block_sum) {
   ```



##########
cpp/src/arrow/compute/kernels/scalar_set_lookup.cc:
##########
@@ -67,8 +67,10 @@ 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) {
+      auto on_found = [&, memo_size](int32_t memo_index) {

Review Comment:
   ```suggestion
         // (capture `memo_index` by value because of ARROW-17567
         auto on_found = [&, memo_size](int32_t memo_index) {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org