[clang] [clang][AST] Fix crash on labeled break/continue within switch condition statement expression (PR #228655)

Ambrose Leeb via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 09:58:19 PDT 2026


Sirraide wrote:

> but for some reason it fails to emit the _"this use of statement expressions is not supported..."_ note alongside the error.

@Expertcoderz The fact that we don’t support break/return/continue inside of a statement expression is purely a limitation of the old constant evaluator (because the function that evaluates a statement expression returns a `bool` rather than an `EvalStmtResult`). I wouldn’t be surprised if the new constant interpreter simply didn’t have this issue, so it’s fine if it accepts break/continue/return in a statement expression provided that it’s valid

https://github.com/llvm/llvm-project/pull/228655


More information about the cfe-commits mailing list