================ @@ -134,18 +135,25 @@ class UncountedLocalVarsChecker bool shouldVisitTemplateInstantiations() const { return true; } bool shouldVisitImplicitCode() const { return false; } + bool TraverseDecl(Decl *D) { + llvm::SaveAndRestore SavedDecl(DeclWithIssue); + if (D && isa<FunctionDecl>(D)) ---------------- haoNoQ wrote:
You can avoid this if-statement by overriding the `TraverseFunctionDecl` method instead. Though, on the other hand, you might want to include `ObjCMethodDecl` too, in case you run into any ObjC code. (It doesn't inherit from `FunctionDecl`.) Which is slightly less convenient to do if you split it into `Traverse...` methods. So ultimately up to you^^ https://github.com/llvm/llvm-project/pull/109389 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits