[clang] [clang] Fix enum/non-enum conditional warning in ParseStmt Followup (PR #207503)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 4 02:57:21 PDT 2026
https://github.com/Disservin created https://github.com/llvm/llvm-project/pull/207503
Missed two other cases, so a follow up to https://github.com/llvm/llvm-project/pull/207085
>From 53f2807aaabbcf0151c60f9b4d7a2dd21d0cbb6a Mon Sep 17 00:00:00 2001
From: Disservin <disservin.social at gmail.com>
Date: Sat, 4 Jul 2026 11:56:26 +0200
Subject: [PATCH] [clang] Fix enum/non-enum conditional warning in ParseStmt
Followup
---
clang/lib/Parse/ParseStmt.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index f9c7d0988b403..53737f16f3869 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -1795,7 +1795,7 @@ StmtResult Parser::ParseDoStatement(LabelDecl *PrecedingLabel) {
// C99 6.8.5p5 - In C99, the do statement is a block. This is not
// the case for C90. Start the loop scope.
- unsigned ScopeFlags = getLangOpts().C99 ? Scope::DeclScope : 0;
+ unsigned ScopeFlags = getLangOpts().C99 ? Scope::DeclScope : Scope::NoScope;
ParseScope DoScope(this, ScopeFlags);
// OpenACC Restricts a do-while-loop inside of certain construct/clause
@@ -1922,8 +1922,8 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc,
// doesn't cause declarations to bind to this scope. We use this to avoid
// diagnosing a comma operator in e.g. the third part of a for loop when
// '-Wcomma' is enabled.
- unsigned ScopeFlags =
- Scope::ControlScope | (C99orCXXorObjC ? Scope::DeclScope : 0);
+ unsigned ScopeFlags = Scope::ControlScope |
+ (C99orCXXorObjC ? Scope::DeclScope : Scope::NoScope);
ParseScope ForScope(this, ScopeFlags);
BalancedDelimiterTracker T(*this, tok::l_paren);
More information about the cfe-commits
mailing list