================
@@ -2313,10 +2313,8 @@ StmtResult Parser::ParseBreakOrContinueStatement(bool 
IsContinue) {
       // TODO: Make this a compatibility/extension warning instead once the
       // syntax of this feature is finalised.
       Diag(LabelLoc, diag::err_c2y_labeled_break_continue) << IsContinue;
-    if (!Target) {
+    if (!Target)
       Diag(LabelLoc, diag::err_break_continue_label_not_found) << IsContinue;
-      return StmtError();
----------------
Sirraide wrote:

> Well what we have is `RecoveryExpr` and `Expr::containsErrors`, but none of 
> those are used for broken break statements (one of the reasons being that 
> they aren't expressions).

That and they’re also just not created if `-frecovery-AST` isn’t passed.

> We can also mark declarations as invalid but that has other side-effects like 
> not taking part in later name lookup, which causes weird diagnostics.

Yeah, in this case it’s not really the declaration that is invalid but rather 
the body.

https://github.com/llvm/llvm-project/pull/168332
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to