================
@@ -642,7 +642,9 @@ class LineJoiner {
return 0;
const auto N = MergedLines + LinesToBeMerged;
// Check if there is even a line after the inner result.
- if (std::distance(I, E) <= N)
+ auto Distance = std::distance(I, E);
+ assert(Distance >= 0);
+ if (static_cast<decltype(N)>(Distance) <= N)
----------------
DavidSpickett wrote:
That requires C++20 (https://en.cppreference.com/w/cpp/utility/intcmp.html) and
we're still on 17.
I will remove the assert and I didn't realise I could put it all in the if,
that's neat.
https://github.com/llvm/llvm-project/pull/172627
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits