Closed
Description
Title: Function expression not parsed as index argument.
Minimal reproducer (https://cpp2.godbolt.org/z/zfhqKhGWv):
t: type = {
operator[]: (this, f) = { }
}
main: () -> int = {
(x := t()) {
x[:() -> _ = 0];
}
}
x[:() -> _ = 0;];
Commands:
cppfront -clean-cpp1 main.cpp2
Expected result:
Same as using these:
x[(:() -> _ = 0)];
x[(:() -> _ = 0;)];
Actual result and error:
main.cpp2(6,18): error: unexpected text - [ is not properly matched by ] (at '0')
main.cpp2(6,19): error: unexpected text - [ is not properly matched by ] (at ';')