I'll update to the latest revision then! Benoit
> -----Original Message----- > From: John McCall [mailto:[email protected]] > Sent: 31 août 2010 18:25 > To: Benoit Belley > Cc: Yves Boudreault; Francesco Iorio; [email protected] > Subject: Re: [cfe-commits] [Patch][Review request] RecursiveASTVisitor > can now traverse template specializations > > On Aug 31, 2010, at 2:57 PM, Benoit Belley wrote: > > I have made good progress today with the help of your comments. > > Glad to hear it! > > > Visiting the class template definition while skipping the re- > declarations turns out to be not so obvious. FunctionDecl and VarDecl > have isThisDeclarationADefiniton(). RecordDecl has getDefintion()... > But, ClassTemplateDecl has none of this. I have found that the > following trick seems to work in practice: > > > > ClassTemplateDecl* D = ...; > > CXXRecordDecl* TemplDecl = D->getTemplatedDecl(); > > if (TemplDecl) { > > if (CXXRecordDecl* TemplDef = TemplDecl->getDefinition()) { > > if (TemplDecl == TemplDef) { > > TRY_TO(TraverseImplicitClassInstantiations(D)); > > } > > } > > } > > > > Is this the correct approach ? > > This works, but it's sufficient to call isDefinition() on the templated > decl. I've also just added isThisDeclarationADefinition() overloads to > the template decls, so it should be even easier. :) > > John. _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
