what is the order of Visit* methods in RecursiveASTVisitor?

For example, for two method VisitFunctionDecl and VisitCXXMethodDecl
implmented in my visitor, what is the order of this two method invoked when
analyze the CXX method?1. VisitFunctionDecl first or VisitCXXMethodDecl
first?2. just invoke VisitCXXMethodDecl?3 just invoke
VisitFunctionDecl?really thanks for help.

Hi lotay,

For example, for two method VisitFunctionDecl and VisitCXXMethodDecl
implmented in my visitor, what is the order of this two method invoked when
analyze the CXX method?1. VisitFunctionDecl first or VisitCXXMethodDecl
first?2. just invoke VisitCXXMethodDecl?3 just invoke
VisitFunctionDecl?really thanks for help.

I always find this confusing as well, and I've had great help from
this design doc e-mail from a few years back:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-June/009322.html

It appears it walks up the hierarchy recursively and then visits each
generation's node, so it should be VisitFunctionDecl and then
VisitCXXMethodDecl.

- Kim

Hi Kim.

That really helps me, thanks a lot.