diff --git a/llvm/include/llvm/CodeGen/LiveInterval.h b/llvm/include/llvm/CodeGen/LiveInterval.h index 51ffe28074345..5a3c488aa338d 100644 --- a/llvm/include/llvm/CodeGen/LiveInterval.h +++ b/llvm/include/llvm/CodeGen/LiveInterval.h @@ -625,10 +625,8 @@ namespace llvm { // if the Seg is lower find first segment that is above Idx using binary // search if (Seg->end <= *Idx) { - Seg = std::upper_bound( - ++Seg, EndSeg, *Idx, - [=](std::remove_reference_t V, - const std::remove_reference_t &S) { + Seg = + std::upper_bound(++Seg, EndSeg, *Idx, [=](auto V, const auto &S) { return V < S.end; }); if (Seg == EndSeg)