Local variable not correctly captured in field initialization expression of anonymous class

Description

I think this is a bug somewhere in the front-end. The same incorrect output happens on both the C++ and Java backends.

Given the program

The output produced by both backends prints Pairs from 0 to 30 instead of the expected 10 to 30. For example, with the Java backend:

Environment

None

Status

Assignee

VijayV

Reporter

DaveG

Labels

None

Components

Fix versions

Affects versions

Priority

High
Configure