[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)

Ryosuke Niwa via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 28 13:44:21 PDT 2024


================
@@ -54,7 +54,7 @@ class UncountedCallArgsChecker
       bool shouldVisitImplicitCode() const { return false; }
 
       bool TraverseDecl(Decl *D) {
-        if (isa<ClassTemplateDecl>(D) && isRefType(safeGetName(D)))
+        if (D && isa<ClassTemplateDecl>(D) && isRefType(safeGetName(D)))
           return true;
         return RecursiveASTVisitor<LocalVisitor>::TraverseDecl(D);
       }
----------------
rniwa wrote:

Good point. That would be cleaner.

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


More information about the cfe-commits mailing list