[Bug c++/108317] dependent vector field is not causing field of this not to be found for fold expression inside a if constexpr block

2023-01-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108317

--- Comment #4 from Andrew Pinski  ---
I should mention that <0> works but <0,1> fails. That might get a hint to a
person fixing the issue of what is going wrong inside the compiler.

[Bug c++/108317] dependent vector field is not causing field of this not to be found for fold expression inside a if constexpr block

2023-01-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108317

Andrew Pinski  changed:

   What|Removed |Added

Summary|dependent vector field is   |dependent vector field is
   |not causing this to be  |not causing field of this
   |captured for fold   |not to be found for fold
   |expression inside a if  |expression inside a if
   |constexpr block |constexpr block

--- Comment #3 from Andrew Pinski  ---
Simple workaround is to do:


  if constexpr(I)
  {
r.v_[I] = c + this->v_[I] + (I < M ? o.v_[I] : T{});
c = c ? r.v_[I] <= this->v_[I] : r.v_[I] < this->v_[I];
  }
  else
  {
c = (r.v_[I] = this->v_[I] + o.v_[I]) < this->v_[I];
  }