idk about break specifically, but return appearing there via a macro like TRY_OR_RETURN for propagating errors by value seems like something someone would write
Just to be clear, that still works. The change is that breaks and continues in conditions don't apply to that loop. As the release notes point out
for (;;) {
while (({ break; true; })) {}
}
is valid, and now breaks out of the for loop, whereas before it broke out of the while loop. This makes Clang more compatible with GCC, which already did this.
View all comments
Show parent comment
5
u/KeepTheFaxMachine Aug 27 '26
I am really curious if there is a use case for such constructs? I can't think of any, but usually that doesn't mean much...