From 8073da0beed804d0cef1697b72fdc4151457a327 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Wed, 9 Feb 2022 11:25:58 -0800 Subject: [PATCH] [NFC] Fix sign-compare warning in GrammarBNF thanks to int promotion --- clang/lib/Tooling/Syntax/Pseudo/GrammarBNF.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Tooling/Syntax/Pseudo/GrammarBNF.cpp b/clang/lib/Tooling/Syntax/Pseudo/GrammarBNF.cpp index cf3e3e10..b19bed3 100644 --- a/clang/lib/Tooling/Syntax/Pseudo/GrammarBNF.cpp +++ b/clang/lib/Tooling/Syntax/Pseudo/GrammarBNF.cpp @@ -225,7 +225,7 @@ private: "Token-like name {0} is used as a nonterminal", G.symbolName(SID))); } } - for (RuleID RID = 0; RID + 1 < T.Rules.size(); ++RID) { + for (RuleID RID = 0; RID + 1u < T.Rules.size(); ++RID) { if (T.Rules[RID] == T.Rules[RID + 1]) Diagnostics.push_back( llvm::formatv("Duplicate rule: `{0}`", G.dumpRule(RID))); -- 2.7.4