[Bug c++/105839] internal compiler error: in tsubst_omp_for_iterator, at cp/pt.cc:18122 (instantiate_pending_templates -> instantiate_decl -> tsubst_lambda_expr)

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jun 3 17:07:15 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105839

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Adjusted testcase, so that it is already valid C++17:
template <typename T>
void
foo (const T &x)
{
  [&] (auto&& y)
  {
    #pragma omp parallel for
    for (auto&& [v1, v2] : x)
      ;
  } ([]{});
}

void
bar ()
{
  int a[10];
  foo (a);
}


More information about the Gcc-bugs mailing list