abhishek593 commented on PR #49348:
URL: https://github.com/apache/arrow/pull/49348#issuecomment-3936596863

   @pitrou I just want to post my analysis here.
   
   The code so far what I have submitted is standard-compliant (compiles on 
gcc-14, gcc-15, clang). But the check [C++ / C++ Minimal Build 
Example](https://github.com/apache/arrow/actions/runs/22235190347/job/64324893309?pr=49348)
 fails which uses gcc-13. This is because of a bug in gcc-13 when evaluating 
concept-constrained partial specialisation of nested templates. Hence, the 
error:
   
   
   Error from CI:
   
   ```
   /arrow/cpp/src/arrow/compute/kernels/codegen_internal.h:736:21: error: 
'Arg0Value' has not been declared
   
     736 |           arg0, [&](Arg0Value v) { return 
builder.Append(functor.op.Call(ctx, v, &st)); },
   ```
   Code from codegen_internal.h(present in my changes):
   
   ```
   template <arrow_c_number_or_decimal Type>
   struct ArrayExec<Type> {
     static Status Exec(...) {
       // GCC 13 throws an error on `Arg0Value` and `OutValue` inside this 
lambda
       VisitArrayValuesInline<Arg0Type>(arg0, [&](Arg0Value v) {
         *out_data++ = functor.op.template Call<OutValue, Arg0Value>(ctx, v, 
&st);
       });
     }
   };
   ```
   
   Since CI uses these older compilers, we may have a few options if we want to 
proceed:
   
   1. Explicit qualification: Explicitly qualify the types wherever they are 
used inside the specialisation
   
   ```diff
   -   VisitArrayValuesInline<Arg0Type>(arg0, [&](Arg0Value v) {
   -      *out_data++ = functor.op.template Call<OutValue, Arg0Value>(ctx, v, 
&st);
   +   VisitArrayValuesInline<Arg0Type>(arg0, [&](typename ThisType::Arg0Value 
v) {
   +      *out_data++ = functor.op.template Call<typename ThisType::OutValue, 
typename ThisType::Arg0Value>(ctx, v, &st);
   ```
   
   2. Identify such instances and fallback to SFINAE (lot of work).
   3. Upgrade CI compilers.
   
   BTW, is there any reason why compilers are not being upgraded?


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to