[clang-tidy] Update UnusedReturnValueCheck types
authorRoy Jacobson <roy@dragonflydb.io>
Mon, 29 May 2023 19:57:39 +0000 (22:57 +0300)
committerRoy Jacobson <roy@dragonflydb.io>
Mon, 29 May 2023 20:02:32 +0000 (23:02 +0300)
Update the types for UnusedReturnValueCheck after D151383.

1. Add std::errc, std:error_condition
2. Remove `absl::Status` - it's marked as `[[nodiscard]]` anyway so it's redundant (and might create double warnings) to check it.

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D151650

clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst

index f813938..bdc601c 100644 (file)
@@ -127,9 +127,10 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name,
                                    "::ttyname")),
       CheckedReturnTypes(utils::options::parseStringList(
           Options.get("CheckedReturnTypes", "::std::error_code;"
+                                            "::std::error_condition;"
+                                            "::std::errc;"
                                             "::std::expected;"
-                                            "::boost::system::error_code;"
-                                            "::abseil::Status"))) {}
+                                            "::boost::system::error_code"))) {}
 
 void UnusedReturnValueCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
   Options.store(Opts, "CheckedFunctions", CheckedFunctions);
index 89c781b..c9b24db 100644 (file)
@@ -50,7 +50,7 @@ Options
 
    Semicolon-separated list of function return types to check.
    By default the following function return types are checked:
-   `::std::error_code`, `::std::expected`, `::boost::system::error_code`, `::abseil::Status`
+   `::std::error_code`, `::std::error_condition`, `::std::errc`, `::std::expected`, `::boost::system::error_code`
 
 `cert-err33-c <../cert/err33-c.html>`_ is an alias of this check that checks a
 fixed and large set of standard library functions.