TemplateName and TemplateArgument are now treated as nodes.
Interesting, I didn't know that this iteration happened out-of-order. My https://reviews.llvm.org/D35012 patch (I'll commit it right now) has a RecursiveASTVisitor subclass that tries to traverse the tree in the source order, I think you should move this code:
DEF_TRAVERSE_TMPL_DECL_(Class) DEF_TRAVERSE_TMPL_DECL_(Var) DEF_TRAVERSE_TMPL_DECL_(Function)
to LexicallyOrderedRecursiveASTVisitor subclass instead and change your visitor to derive from LexicallyOrderedRecursiveASTVisitor. You can probably repurpose https://reviews.llvm.org/D36998 and have both the visibility change and the move to LexicallyOrderedRecursiveASTVisitor in that patch.