https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104635
--- Comment #8 from Szüllő Ádám ---
Yes, the code as a whole is invalid.
But for(int i=0; i<4; i++) is well defined.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104635
--- Comment #6 from Szüllő Ádám ---
I'd bothered to read the articles, and there were no new information (nor
relevant to this exact case).
You are right that this is not a bug, becasue the code is invalid, as myself
emphasized too in the descri
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104635
--- Comment #4 from Szüllő Ádám ---
i understand that missing return value is undefined behaviour.
my point is, that this should be limited to the act of return (return with
garbage, segfault, stuck in an infinite loop _after_ the for loop)
wha
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104635
--- Comment #2 from Szüllő Ádám ---
>There's nothing wrong here
how a missing retun statement corrupt an independent code block, with "private"
variable inside it's own scope?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104635
Bug ID: 104635
Summary: for loop optimized into infinite loop
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++