From 7428ab4d8402a2c1bddf9452fe8605b6b68ee605 Mon Sep 17 00:00:00 2001 From: Bruce Collie Date: Mon, 18 Dec 2023 18:39:07 +0000 Subject: [PATCH] Address -bugprone-unchecked-optional-access --- .clang-tidy | 1 - tools/k-rule-apply/main.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 83d0a129a..953cba8d7 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,7 +8,6 @@ Checks: -bugprone-unused-return-value -bugprone-assignment-in-if-condition -bugprone-branch-clone - -bugprone-unchecked-optional-access -bugprone-sizeof-expression -bugprone-implicit-widening-of-multiplication-result modernize-* diff --git a/tools/k-rule-apply/main.cpp b/tools/k-rule-apply/main.cpp index b7d3b5dd8..0bd1208f8 100644 --- a/tools/k-rule-apply/main.cpp +++ b/tools/k-rule-apply/main.cpp @@ -54,7 +54,7 @@ int main(int argc, char **argv) { auto InitialConfiguration = parser.pattern(); auto match_function_name = getMatchFunctionName(); - if (match_function_name == std::nullopt) { + if (!match_function_name.has_value()) { std::cerr << "Rule with label " << RuleLabel << " does not exist.\n"; return EXIT_FAILURE; }