r272867 - [Lex] Try to fix a 'comparison is always false' warning. NFC.

George Burgess IV via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 15 19:30:33 PDT 2016


Author: gbiv
Date: Wed Jun 15 21:30:33 2016
New Revision: 272867

URL: http://llvm.org/viewvc/llvm-project?rev=272867&view=rev
Log:
[Lex] Try to fix a 'comparison is always false' warning. NFC.

Modified:
    cfe/trunk/lib/Lex/PPDirectives.cpp

Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=272867&r1=272866&r2=272867&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Wed Jun 15 21:30:33 2016
@@ -162,7 +162,7 @@ static bool warnByDefaultOnWrongCase(Str
   SmallString<32> LowerInclude{Include};
   for (char &Ch : LowerInclude) {
     // In the ASCII range?
-    if (Ch < 0 || Ch > 0x7f)
+    if (static_cast<unsigned char>(Ch) > 0x7f)
       return false; // Can't be a standard header
     // ASCII lowercase:
     if (Ch >= 'A' && Ch <= 'Z')




More information about the cfe-commits mailing list