#150 closed defect (fixed)
Incorrect Scoping when using continue
Reported by: | Thierry Delisle | Owned by: | |
---|---|---|---|
Priority: | minor | Component: | cfa-cc |
Version: | 1.0 | Keywords: | |
Cc: |
Description
CFA code :
int main() { for(4) { if(true) continue; int num = 0; } }
This should compile normally but results in an error claiming the continue jumps into a scope where num exists but was not initialized.
The reason is that the code is rewritten as :
int main(){ for (4) { if (true) goto __loopContinue; int num = 0; __loopContinue: __attribute__ ((unused)); } }
It should probably be :
int main(){ for (4) { { if (true) goto __loopContinue; int num = 0; } __loopContinue: __attribute__ ((unused)); } }
Change History (2)
comment:1 Changed 5 years ago by
Owner: | set to Thierry Delisle <tdelisle@…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
In 397c101: