]> granicus.if.org Git - clang/commitdiff
For the StringRef check, also visit the children of DeclStmts.
authorTed Kremenek <kremenek@apple.com>
Sun, 14 Feb 2010 19:08:43 +0000 (19:08 +0000)
committerTed Kremenek <kremenek@apple.com>
Sun, 14 Feb 2010 19:08:43 +0000 (19:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96181 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/LLVMConventionsChecker.cpp

index 4e69f2916fdc3abc92064d5075ea2961dfc85988..7cd98b0319202ee8950e1937504c1cb56fec628e 100644 (file)
@@ -74,6 +74,7 @@ public:
   void VisitDeclStmt(DeclStmt *DS);
 private:
   void VisitVarDecl(VarDecl *VD);
+  void CheckStringRefBoundtoTemporaryString(VarDecl *VD);
 };
 } // end anonymous namespace
 
@@ -83,6 +84,8 @@ static void CheckStringRefAssignedTemporary(const Decl *D, BugReporter &BR) {
 }
 
 void StringRefCheckerVisitor::VisitDeclStmt(DeclStmt *S) {
+  VisitChildren(S);
+
   for (DeclStmt::decl_iterator I = S->decl_begin(), E = S->decl_end();I!=E; ++I)
     if (VarDecl *VD = dyn_cast<VarDecl>(*I))
       VisitVarDecl(VD);