[Bug c++/108317] dependent vector field is not causing field of this not to be found for fold expression inside a if constexpr block
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jan 6 18:07:26 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108317
Andrew Pinski <pinskia at gcc dot gnu.org> 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 <pinskia at gcc dot gnu.org> ---
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];
}
More information about the Gcc-bugs
mailing list