diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp index 3d8bbd0ef0dd2537502d3591ccf6a2cd0351969a..fd8334281d0b01edf31c0884c0bcc4e852273212 100644 --- a/lib/Basic/DiagnosticIDs.cpp +++ b/lib/Basic/DiagnosticIDs.cpp @@ -503,10 +503,6 @@ static const WarningOption OptionTable[] = { #undef GET_DIAG_TABLE }; -static bool WarningOptionCompare(const WarningOption &LHS, StringRef RHS) { - return LHS.getName() < RHS; -} - /// getWarningOptionForDiag - Return the lowest-level warning option that /// enables the specified diagnostic. If there is no -Wfoo flag that controls /// the diagnostic, this returns null. @@ -549,9 +545,11 @@ static bool getDiagnosticsInGroup(diag::Flavor Flavor, bool DiagnosticIDs::getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group, SmallVectorImpl<diag::kind> &Diags) const { - const WarningOption *Found = std::lower_bound(std::begin(OptionTable), - std::end(OptionTable), - Group, WarningOptionCompare); + auto Found = std::lower_bound(std::begin(OptionTable), std::end(OptionTable), + Group, + [](const WarningOption &LHS, StringRef RHS) { + return LHS.getName() < RHS; + }); if (Found == std::end(OptionTable) || Found->getName() != Group) return true; // Option not found.