Hi,<br><br>Using a RecursiveASTVisitor, I've been trying to rename field names against some conventions.<br><br>Let's say I would like to rename Foo::bar into Foo::m_bar in the following code:<br><br>template<typename T><br>
struct Foo<br>{<br> int bar;<br>};<br><br>int main()<br>{<br> Foo<double> foo;<br> foo.bar = 2;<br><br> return 1;<br>}<br><br><br>In my custom visitor, I implement the following method:<br>
<br>
bool VisitMemberExpr(MemberExpr* member)<br>
{<br>
ValueDecl* v = member->getMemberDecl(); // FieldDecl or CXXMethodDecl<br>
...<br>
}<br><br>But the FieldDecl I get when visiting the statement corresponding to "foo.bar=2;" is Foo<double>::bar, but not Foo::bar.<br><br>So my question is: is it possible to get the FieldDecl of Foo<T>::bar from the FieldDecl of Foo<double>::bar ? at least when the struct is not specialized? <br>
What happens when the struct is specialized?<br><br><br>Thanks,<br>Adrien<br><br><br><br><br><br>