[clang-tools-extra] [clang-tidy][cppcoreguidelines-missing-std-forward] Do not warn when the parameter is used in a `static_cast<T&>`. (PR #99477)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 13 09:50:23 PDT 2024


================
@@ -86,6 +88,15 @@ AST_MATCHER(VarDecl, hasIdentifier) {
 
 } // namespace
 
+MissingStdForwardCheck::MissingStdForwardCheck(StringRef Name,
+                                               ClangTidyContext *Context)
+    : ClangTidyCheck(Name, Context),
+      IgnoreStaticCasts(Options.get("IgnoreStaticCasts", false)) {}
----------------
5chmidti wrote:

The option name sounds too generic, and suggests that users can then use any static cast without a diagnostic being generated. Maybe `IgnoreStaticCastToLValueReference` (or something else)

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


More information about the cfe-commits mailing list