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 TRY_TO(TraverseType(D->getType())); return true; }) ---------------- Same problem here? ================ Comment at: include/clang/AST/RecursiveASTVisitor.h:2430 TRY_TO(TraverseDecl(S->getBlockDecl())); return true; // no child statements to loop through. }) ---------------- Likewise. https://reviews.llvm.org/D34030 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits