<div>Here's one way:<br></div><div><br></div><div><div> // Member's within class/struct/union:</div><div> bool VisitFieldDecl( FieldDecl * f )</div><div> {</div><div> RecordDecl * r = f->getParent() ;</div>
<div> const QualType & theMembersClassType = context.getRecordType( r ) ;</div><div> TypeSourceInfo * pThisFieldSourceInfo = f->getTypeSourceInfo() ;</div><div> TypeLoc thisFieldTypeLoc = pThisFieldSourceInfo->getTypeLoc() ;</div>
<div> const QualType & thisFieldQualType = thisFieldTypeLoc.getType() ;</div><div><br></div><div> cout</div><div> << theMembersClassType.getAsString()</div><div> << " : " << thisFieldQualType.getAsString() << endl ;</div>
<div><br></div><div> return true ;</div><div> }</div></div><div><br></div><div>--</div><div class="gmail_extra">Peeter</div>