[clang] aa245dd - [clang][lex] NFC: Add explicit cast to silence -Wsign-compare
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 22 03:21:56 PDT 2021
Author: Jan Svoboda
Date: 2021-07-22T12:21:12+02:00
New Revision: aa245ddd4627c98083eb372b95e049073aeb36d2
URL: https://github.com/llvm/llvm-project/commit/aa245ddd4627c98083eb372b95e049073aeb36d2
DIFF: https://github.com/llvm/llvm-project/commit/aa245ddd4627c98083eb372b95e049073aeb36d2.diff
LOG: [clang][lex] NFC: Add explicit cast to silence -Wsign-compare
Added:
Modified:
clang/lib/Lex/LiteralSupport.cpp
Removed:
################################################################################
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp
index bfcb3c478b62d..85d826ce9c6f7 100644
--- a/clang/lib/Lex/LiteralSupport.cpp
+++ b/clang/lib/Lex/LiteralSupport.cpp
@@ -1660,7 +1660,8 @@ void StringLiteralParser::init(ArrayRef<Token> StringToks){
constexpr unsigned MaxRawStrDelimLen = 16;
const char *Prefix = ThisTokBuf;
- while (ThisTokBuf - Prefix < MaxRawStrDelimLen && ThisTokBuf[0] != '(')
+ while (static_cast<unsigned>(ThisTokBuf - Prefix) < MaxRawStrDelimLen &&
+ ThisTokBuf[0] != '(')
++ThisTokBuf;
if (ThisTokBuf[0] != '(')
return DiagnoseLexingError(StringToks[i].getLocation());
More information about the cfe-commits
mailing list