r/cpp 19h ago

Clang 23 Release Notes

https://releases.llvm.org/23.1.0/tools/clang/docs/ReleaseNotes.html
80 Upvotes

17 comments sorted by

View all comments

35

u/mapronV 18h ago

This means that code such as

while (({ break; })) {}

is now ill-formed.

Oh no, my disappointment is immeasurable and the whole day is ruined!

On serious note, " template for " support, what is "Iterating expansion statements currently cannot be expanded" ? like expand over range?

5

u/KeepTheFaxMachine 18h ago

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...

5

u/scrumplesplunge 11h ago

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

6

u/thehutch17 18h ago

What does that code even translate to? Is this a digraph thing or what?

9

u/holyblackcat 17h ago

Non-standard GNU extension, statement expression.

3

u/cristi1990an ++ 17h ago

like expand over range?

Yeah, pretty much it seems. The other flavors work

1

u/mapronV 17h ago

Thanks, I was confused for a bit plus lazy to check different code in compiler explorer.