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

Chandler Carruth chandlerc at google.com
Thu Aug 18 09:01:55 PDT 2011


Looks good, please commit.

On Thu, Aug 18, 2011 at 8:56 AM, Manuel Klimek <klimek at google.com> wrote:

> 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
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110818/6ec202da/attachment.html>


More information about the cfe-commits mailing list