[clang] [alpha.webkit.UncountedLocalVarsChecker] Handle null Type in CanTriviallyDestruct (PR #182129)

Ryosuke Niwa via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 18 18:17:24 PST 2026


================
@@ -272,9 +272,9 @@ class RawPtrRefLocalVarsChecker
       }
 
       bool TraverseClassTemplateDecl(ClassTemplateDecl *Decl) override {
-        if (isSmartPtrClass(safeGetName(Decl)))
-          return true;
-        return DynamicRecursiveASTVisitor::TraverseClassTemplateDecl(Decl);
+        // We don't traverse primary templates because we only care about
+        // specializations (instantiations).
+        return true;
       }
----------------
rniwa wrote:

So I tried that and added `return true` in other checker's `TraverseClassTemplateDecl` but we still hit this assertion in a bunch of other places while trying to build WebKit. As far as I can tell, these static analyzers stumble upon dependent context in various different ways right now. It's possible we can fix that but it's probably a much bigger project than adding `return true` in a couple of places where we traverse a template declaration.

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


More information about the cfe-commits mailing list