Thanks Yang,<div><br></div><div>That works nicely.<br>
<div><br></div><div>However, any idea why this test attempt doesn't correctly identify the anonymous nature of the type:<br><br><div> string s ;</div><div> if ( r->isAnonymousStructOrUnion() )</div><div>
{<br></div><div> const Type * RT = r->getTypeForDecl() ;</div><div> QualType QT = RT->getCanonicalTypeInternal() ;<br></div><div><br></div><div> s = QT.getAsString() ;</div><div> }</div>
</div><div> else</div><div> {</div><div> s = r->getName().str() ;</div><div> }</div><div><br></div><div>I can work around this by using the following instead:</div><div><br></div><div> string s = r->getName().str() ;<br>
</div><div> if ( "" == s )<br></div><div> // else removed.</div><div><br></div><div>but it seems like an odd thing to do (try to format the object as a string to test an attribute).</div><div><br></div>
<div>Peeter</div></div><div class="gmail_extra"><br>
</div>