https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108317
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target|#1 SMP PREEMPT_DYNAMIC Sat, | |31 Dec 2022 17:40:35 +0000 | Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2023-01-06 Summary|g++ is unable to capture |dependent vector field is |vector-extended variables |not causing this to be | |captured for fold | |expression inside a if | |constexpr block Host|#1 SMP PREEMPT_DYNAMIC Sat, | |31 Dec 2022 17:40:35 +0000 | --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Reduced testcase: template <typename T> struct pint { T __attribute__ ((vector_size (2 * sizeof(T)))) v_; void f(pint const& o) { [&]<int ...I>() { ( [&]() noexcept { if constexpr(I) { v_[I]; } }(), ... ); }.template operator()<0, 1>(); } }; int main() { using D = pint<int>; D a; D b; a.f(b); return 0; }