[clang] 2bbb6c0 - [clang][NFC] Spell out DynTypedNode instead of auto (#114427)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 6 03:15:15 PST 2024


Author: Chris Cotter
Date: 2024-11-06T12:15:11+01:00
New Revision: 2bbb6c067020bef50435c2ba5addcd66d1b9a1dd

URL: https://github.com/llvm/llvm-project/commit/2bbb6c067020bef50435c2ba5addcd66d1b9a1dd
DIFF: https://github.com/llvm/llvm-project/commit/2bbb6c067020bef50435c2ba5addcd66d1b9a1dd.diff

LOG: [clang][NFC] Spell out DynTypedNode instead of auto (#114427)

Added: 
    

Modified: 
    clang/include/clang/ASTMatchers/ASTMatchers.h
    clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index c77140842d7a6e..4bcaa953a61af2 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -3226,7 +3226,7 @@ AST_MATCHER_P(CXXDependentScopeMemberExpr, memberHasSameNameAsBoundNode,
 
   return Builder->removeBindings(
       [this, MemberName](const BoundNodesMap &Nodes) {
-        const auto &BN = Nodes.getNode(this->BindingID);
+        const DynTypedNode &BN = Nodes.getNode(this->BindingID);
         if (const auto *ND = BN.get<NamedDecl>()) {
           if (!isa<FieldDecl, CXXMethodDecl, VarDecl>(ND))
             return true;

diff  --git a/clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp b/clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp
index 6bc2ce6686ed64..46690dd886b2be 100644
--- a/clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp
@@ -38,7 +38,7 @@ namespace clang {
 namespace ast_matchers {
 AST_MATCHER_P(StringLiteral, mentionsBoundType, std::string, BindingID) {
   return Builder->removeBindings([this, &Node](const BoundNodesMap &Nodes) {
-    const auto &BN = Nodes.getNode(this->BindingID);
+    const DynTypedNode &BN = Nodes.getNode(this->BindingID);
     if (const auto *ND = BN.get<NamedDecl>()) {
       return ND->getName() != Node.getString();
     }


        


More information about the cfe-commits mailing list