[PATCH] D151650: [clang-tidy] Update UnusedReturnValueCheck types

Roy Jacobson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 29 06:59:39 PDT 2023


royjacobson created this revision.
royjacobson added reviewers: chaitanyav, PiotrZSL.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
royjacobson requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Update the types for UnusedReturnValueCheck after D151383 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151650

Files:
  clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp


Index: clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
@@ -126,10 +126,12 @@
                                    "::strsignal;"
                                    "::ttyname")),
       CheckedReturnTypes(utils::options::parseStringList(
-          Options.get("CheckedReturnTypes", "::std::error_code;"
-                                            "::std::expected;"
-                                            "::boost::system::error_code;"
-                                            "::abseil::Status"))) {}
+          Options.get("CheckedReturnTypes",
+                      "::std::error_code;",
+                      "::std::error_condition;",
+                      "::std::errc;",
+                      "::std::expected;",
+                      "::boost::system::error_code"))) {}
 
 void UnusedReturnValueCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
   Options.store(Opts, "CheckedFunctions", CheckedFunctions);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151650.526439.patch
Type: text/x-patch
Size: 1162 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230529/a238bde9/attachment.bin>


More information about the cfe-commits mailing list