[clang-tools-extra] [clang-tidy] Add check hicpp-ignored-remove-result (PR #73119)

Björn Svensson via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 6 16:32:20 PST 2023


================
@@ -133,6 +133,11 @@ UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name,
                                             "::boost::system::error_code"))),
       AllowCastToVoid(Options.get("AllowCastToVoid", false)) {}
 
+UnusedReturnValueCheck::UnusedReturnValueCheck(llvm::StringRef Name,
----------------
bjosv wrote:

Added a constructor that initialized the (missing) CheckedReturnTypes and AllowCastToVoid, which is delegated to from the constructor that is used by the new checker.
Is this in line with your thoughts?

An alternative is to only have the constructor which sets all members, but I thought that looked a bit weird to set AllowCastToVoid twice when constructing IgnoredRemoveResultCheck, once when initializing the baseclass and secondly in the body to be able to use Options.get (which can't be called in the initialization list there).


https://github.com/llvm/llvm-project/pull/73119


More information about the cfe-commits mailing list