summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Basic/DiagnosticIDs.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp
index 3d8bbd0ef0d..fd8334281d0 100644
--- a/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud