]> granicus.if.org Git - clang/commitdiff
Ensure that we actually visit function parameter declarations with
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Wed, 6 Jul 2011 23:35:33 +0000 (23:35 +0000)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Wed, 6 Jul 2011 23:35:33 +0000 (23:35 +0000)
RecursiveASTVisitor.

This deficiency was discovered while working with the AST matcher
framework and likely impacts other users of RecursiveASTMatcher who
previously weren't seeing these Decls in their visitation.

Patch reviewed by Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134562 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/RecursiveASTVisitor.h

index 7cdb0adc65d3b37f991b18d82ed136f22148c6a8..1982b3513840221c32c8fafbf736e4ee7d37ddd4 100644 (file)
@@ -1562,6 +1562,13 @@ bool RecursiveASTVisitor<Derived>::TraverseFunctionHelper(FunctionDecl *D) {
   // including exception specifications.
   TRY_TO(TraverseTypeLoc(D->getTypeSourceInfo()->getTypeLoc()));
 
+  // Parameter declarations
+  for (FunctionDecl::param_iterator I = D->param_begin(),
+                                    E = D->param_end();
+       I != E; ++I) {
+    TRY_TO(TraverseDecl(*I));
+  }
+
   if (CXXConstructorDecl *Ctor = dyn_cast<CXXConstructorDecl>(D)) {
     // Constructor initializers.
     for (CXXConstructorDecl::init_iterator I = Ctor->init_begin(),