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

Clement Courbet via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 19 01:13:39 PDT 2024


================
@@ -129,15 +129,19 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) {
       unless(anyOf(hasAncestor(typeLoc()),
                    hasAncestor(expr(hasUnevaluatedContext())))));
 
+  auto StaticCast = cxxStaticCastExpr(
+      hasSourceExpression(declRefExpr(to(equalsBoundNode("param")))));
----------------
legrosbuffle wrote:

Unfortunately at that point the cast is a `CK_Dependent` cast. I don't think we can get any kind type information from those casts, but I might be wrong.

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


More information about the cfe-commits mailing list