[clang] [clang-tools-extra] [C2y] Implement WG14 N3409 (PR #130299)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 7 10:12:55 PST 2025
================
@@ -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:
Either github is having a stroke or something went wrong here because I don’t think this has anything to do with this pr. 👀
https://github.com/llvm/llvm-project/pull/130299
More information about the cfe-commits
mailing list