================
@@ -3647,10 +3660,25 @@ static void sortCppIncludes(const FormatStyle &Style,
LHSFilenameLower = Includes[LHSI].Filename.lower();
RHSFilenameLower = Includes[RHSI].Filename.lower();
}
- return std::tie(Includes[LHSI].Priority, LHSStemLower, LHSStem,
- LHSFilenameLower, Includes[LHSI].Filename) <
- std::tie(Includes[RHSI].Priority, RHSStemLower, RHSStem,
- RHSFilenameLower, Includes[RHSI].Filename);
+
+ const auto Compare = Style.SortIncludes.Natural
+ ? &StringRef::compare_numeric
+ : &StringRef::compare;
+
+ if (Style.SortIncludes.IgnoreCase) {
+ if (int Cmp = (StringRef(LHSStemLower).*Compare)(RHSStemLower))
----------------
tshakalekholoane wrote:
I assume you mean `std::invoke`? `std::apply` would require packing the
arguments into tuples and a [possible implementation of
this](https://en.cppreference.com/cpp/utility/apply#Possible_implementation)
seems to just forward to `std::invoke`.
https://github.com/llvm/llvm-project/pull/210788
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits