On Mon, 4 Dec 2023 14:49:24 GMT, Weijun Wang <wei...@openjdk.org> wrote:
> I don't like all those duplicated lines. Why do you think the previous fix is > a hack? I would guess the C++ designers are also not happy of this > restriction so they provide us a way to avoid it. Maybe they will enhance it > again sometime in the future? The previous fix of splitting it into a declaration and assignment is not any safer than just one single definition when it comes to being jumped over by gotos, so it is simply a no-op to silence well intentioned compiler warnings, and also has the added downside of not being obvious why it is structured like that, and can be easily undone by future changes not realizing this will break compilation. Unfortunately the only true way to fix this is to remove the gotos that are affected, and making the control flow explicit, though there might be a better solution that I haven't thought of yet. Maybe moving the labels into a common place where it doesn't jump over locals might just work ------------- PR Comment: https://git.openjdk.org/jdk/pull/16682#issuecomment-1840120553