[clang-format] Fix MSVC "unsafe use of type 'bool' in operation" warning (NFC)
authorYang Fan <nullptr.cpp@gmail.com>
Wed, 3 Feb 2021 02:48:39 +0000 (10:48 +0800)
committerYang Fan <nullptr.cpp@gmail.com>
Wed, 3 Feb 2021 02:50:59 +0000 (10:50 +0800)
MSVC warning:
```
\llvm-project\clang\lib\Format\BreakableToken.cpp(1002): warning C4804: '-': unsafe use of type 'bool' in operation
```

clang/lib/Format/BreakableToken.cpp

index 4ac97ee..4559048 100644 (file)
@@ -999,7 +999,7 @@ void BreakableLineCommentSection::adaptStartOfLine(
     const auto SpacesToAdd = std::max(PrefixSpaceChange[LineIndex], 0);
     Whitespaces.replaceWhitespaceInToken(
         tokenAt(LineIndex), OriginalPrefix[LineIndex].size() - SpacesToRemove,
-        /*ReplaceChars=*/SpacesToRemove, "", "", -/*InPPDirective=*/false,
+        /*ReplaceChars=*/SpacesToRemove, "", "", /*InPPDirective=*/false,
         /*Newlines=*/0, /*Spaces=*/SpacesToAdd);
   }
 }