<div dir="ltr">Thanks Dmitri,<div><br></div><div style>That avoids the abort with that particular template in our source.  However, for other places, isDependentType() seems a bit more stringent than required.  For example, the m_pNext field of the following class:</div>
<div><br><div>template <class DATA_TYP></div><div>struct noInheritance</div><div>{</div><div>   noInheritance<DATA_TYP>* m_pNext;</div><div>   int m_priKey;</div><div>};</div><div style><br>gets flagged as a dependent type, yet this is something that one should logically be able to execute getTypeSize() on [and in fact one can without trouble].</div>
<div class="gmail_extra" style><br>This is my current visitor source:<br></div></div><div class="gmail_extra" style><br></div><div class="gmail_extra" style><div class="gmail_extra">bool VisitFieldDecl( FieldDecl * f )</div>
<div class="gmail_extra">{</div><div class="gmail_extra">   RecordDecl * r = f->getParent() ;</div><div class="gmail_extra">   TypeSourceInfo * pThisFieldSourceInfo = f->getTypeSourceInfo() ;</div><div class="gmail_extra">
   TypeLoc thisFieldTypeLoc = pThisFieldSourceInfo->getTypeLoc() ;</div><div class="gmail_extra">   const QualType & thisFieldQualType = thisFieldTypeLoc.getType() ;</div><div class="gmail_extra">   const Type * t = thisFieldTypeLoc.getTypePtr() ;</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">   const QualType & theMembersClassType = m_context.getRecordType( r ) ;</div><div class="gmail_extra"><br></div><div class="gmail_extra">   if ( !t->isDependentType() )</div>
<div class="gmail_extra">   {</div><div class="gmail_extra">      size_t szInBits = m_context.getTypeSize( thisFieldQualType ) ;</div><div class="gmail_extra">      size_t offsetInBits = m_context.getFieldOffset( f ) ;</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">      cout</div><div class="gmail_extra">         << "[" << offsetInBits/8 << "]:\t"</div><div class="gmail_extra">         << theMembersClassType.getAsString( m_pp ) << "::" << thisFieldQualType.getAsString( m_pp ) << "\t" << f->getNameAsString()</div>
<div class="gmail_extra">         << "\tsize: " << szInBits/8 << endl ;</div><div class="gmail_extra">         ;</div><div class="gmail_extra">   }</div><div class="gmail_extra"><br></div><div class="gmail_extra">
   return true ;</div><div class="gmail_extra">}</div><div style><br>any suggestion how to weaken the isDependentType() checking here to allow it's use on the field noInheritance::m_pNext above, but still avoid the abort that occurs with <span style="font-family:arial,sans-serif;font-size:12.499999046325684px">OSS_STRUCTURE_PAD_DELTA::pad?</span></div>
<div style><span style="font-family:arial,sans-serif;font-size:12.499999046325684px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:12.499999046325684px">Peeter</span></div></div></div>