================
@@ -2269,11 +2269,10 @@ StmtResult Sema::ActOnForStmt(SourceLocation ForLoc,
SourceLocation LParenLoc,
for (auto *DI : DS->decls()) {
if (VarDecl *VD = dyn_cast<VarDecl>(DI)) {
VarDeclSeen = true;
- if (VD->isLocalVarDecl() && !VD->hasLocalStorage())
- Diag(DI->getLocation(),
- getLangOpts().C23
- ? diag::warn_c17_non_local_variable_decl_in_for
- : diag::ext_c23_non_local_variable_decl_in_for);
+ if (VD->isLocalVarDecl() && !VD->hasLocalStorage()) {
+ Diag(DI->getLocation(), diag::err_non_local_variable_decl_in_for);
+ DI->setInvalidDecl();
+ }
----------------
Sirraide wrote:
These changes happens to be something I merged recently, so I think this is
probably just a merge gone wrong on your end?
https://github.com/llvm/llvm-project/pull/130299
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits