NinaRanns / gcc

GNU General Public License v2.0
0 stars 0 forks source link

lambda capture of function parm in a contract does not work (BZ117435) #15

Open iains opened 3 weeks ago

iains commented 3 weeks ago

(another upstream one) as ville reported: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117435

here too in case we forget...

void f2 (int x) [[pre: []{return x;}()]] {}

int main ()
{
  f2 (5);
}

ICEs
during RTL pass: expand
l.C: In lambda function:
l.C:17:34: internal compiler error: in expand_expr_real_1, at expr.cc:11415
   17 | void f2 (int x) [[pre: []{return x;}()]] {}

it looks to me like 'x' is not captured - probably because the function f2 () is not started and therefore the lambda is not considered nested.