[clang-tools-extra] 40af06c - [clang-tidy] Update UnusedReturnValueCheck types

Roy Jacobson via cfe-commits cfe-commits at lists.llvm.org
Mon May 29 13:02:39 PDT 2023


Author: Roy Jacobson
Date: 2023-05-29T23:02:32+03:00
New Revision: 40af06ccc7bf9989b8deb410ed78a4795c22aa73

URL: https://github.com/llvm/llvm-project/commit/40af06ccc7bf9989b8deb410ed78a4795c22aa73
DIFF: https://github.com/llvm/llvm-project/commit/40af06ccc7bf9989b8deb410ed78a4795c22aa73.diff

LOG: [clang-tidy] Update UnusedReturnValueCheck types

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
index f8139381d7e01..bdc601c2445f5 100644
--- a/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
@@ -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);

diff  --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst
index 89c781b0fe714..c9b24dbcbb94f 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/unused-return-value.rst
@@ -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.


        


More information about the cfe-commits mailing list