[PATCH] D34030: Fix the postorder visting of the ClassTemplateSpecializationDecl nodes in the RecursiveASTVisitor.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 4 15:17:34 PST 2018

rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.

Generally this looks good.

Is there some way we can prevent this bug from recurring by construction (eg, by making a `return` ill-formed, or making it "just work")? Wrapping the code block in the `DEF_TRAVERSE_*` invocation in a lambda would help, but would probably significantly increase the compile-time (and possibly code size) cost of `RecursiveASTVisitor`, so I'd prefer a different solution if possible. We could move the post-code-block actions into the destructor of an RAII object, but then we can't suppress running them when the code block returns false. Ideas welcome.

Comment at: include/clang/AST/RecursiveASTVisitor.h:1587
   return true;
Same problem here?

Comment at: include/clang/AST/RecursiveASTVisitor.h:2430
   return true; // no child statements to loop through.


More information about the cfe-commits mailing list