Currently this code fails to compile by the forward reference of foo.
auto foo(int) {
static struct Bar { // [A]
void spam() { foo(1); }
}
return Bar();
}
Because the semantic2 and 3 of the struct Bar is immediately invoked at the declaration point [A].
But, essentially it could be compiled, by deferring the semantic2/3 after the finishing semantic3 of foo.
Comment #1 by robert.schadek — 2024-12-13T18:18:20Z