LRM 1800-2017

Hi,
In the below code from the LRM material(section 6.21 scope and lifetime) the “int loop3 = 0;” is stated as illegal statement but when running this code in EDA playground it works perfectly fine. I understood the behavior of the loop3 valiable as static but what i didn’t get is why LRM mentioned it as illegal statement.
Also few lines above in the same section I see this information
However, an explicit static keyword shall be required when an initialization value is specified as part of a
static variable’s declaration to indicate the user’s intent of executing that initialization only once at the
beginning of the simulation.

If that is the case, are the tools smart enough to understand and rewrite internally?

module top_illegal; // should not compile
initial begin
int svar2 = 2; // static/automatic needed to show intent
for (int i=0; i<3; i++) begin
int loop3 = 0; // illegal statement
for (int i=0; i<3; i++) begin
loop3++;
$display(loop3);
end
end
end
endmodule : top_illegal

In reply to ven@pdx.edu:

This appears to be a popular section of the LRM. Someone asked the same question recently. See here.