[cfe-commits] PATCH: Fix traversal of template nodes in RecursiveASTVisitor

Manuel Klimek klimek at google.com
Thu Aug 18 08:56:18 PDT 2011


RecursiveASTVisitor should call TraverseDecl(...) for every
declaration it visits instead of directly calling the specialized
traverse method.
(also fixes a spelling error)

diff --git a/include/clang/AST/RecursiveASTVisitor.h
b/include/clang/AST/RecursiveASTVisitor.h
index 8f593c1..473ba66 100644
--- a/include/clang/AST/RecursiveASTVisitor.h
+++ b/include/clang/AST/RecursiveASTVisitor.h
@@ -1256,7 +1256,7 @@ bool
RecursiveASTVisitor<Derived>::TraverseClassInstantiations(
           = (U.get<ClassTemplatePartialSpecializationDecl*>() == Pattern);

       if (ShouldVisit)
-        TRY_TO(TraverseClassTemplateSpecializationDecl(SD));
+        TRY_TO(TraverseDecl(SD));
       break;
     }

@@ -1284,7 +1284,7 @@ DEF_TRAVERSE_DECL(ClassTemplateDecl, {
     TRY_TO(TraverseTemplateParameterListHelper(D->getTemplateParameters()));

     // By default, we do not traverse the instantiations of
-    // class templates since they do not apprear in the user code. The
+    // class templates since they do not appear in the user code. The
     // following code optionally traverses them.
     if (getDerived().shouldVisitTemplateInstantiations()) {
       // If this is the definition of the primary template, visit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-traversal-of-class-template-nodes-on-template-in.patch
Type: text/x-patch
Size: 1402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110818/28b6b092/attachment.bin>


More information about the cfe-commits mailing list