<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 25, 2013 at 3:08 PM, Dmitri Gribenko <span dir="ltr"><<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":ze">I guess you are calling getFieldOffset for a field that has a<br>
dependent type? You could dump the record or the field to see what it<br>
is (->dump()).</div></blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">(gdb) p RD->dump()</div><div class="gmail_extra">CXXRecordDecl 0x391a9f0 <.../include/sqlm_metrics.h:2218:4, line:2228:4> struct MetricsPartition</div>
<div class="gmail_extra">|-FullComment 0x3922c30 <line:2217:7, col:35></div><div class="gmail_extra">| `-ParagraphComment 0x3922c00 <col:7, col:35></div><div class="gmail_extra">| `-TextComment 0x3922bd0 <col:7, col:35> Text=" Metrics Partition Definition"</div>
<div class="gmail_extra">|-CXXRecordDecl 0x391ab00 <line:2218:4, col:11> struct MetricsPartition</div><div class="gmail_extra">|-FieldDecl 0x391aba0 <line:2221:7, col:25> metricData 'T'</div><div class="gmail_extra">
...</div><div class="gmail_extra"><br></div><div class="gmail_extra">You were right that this appears to be a dependent type. The declaration was an embedded struct within another explicit template class:</div><div class="gmail_extra">
<br></div><div class="gmail_extra"> template <class T></div><div class="gmail_extra"> class metricsOuter: public allocatorObj</div><div class="gmail_extra"> {</div><div class="gmail_extra"> protected:</div><div class="gmail_extra">
<br></div><div class="gmail_extra"> Uint64 m_numPartitions;</div><div class="gmail_extra"><br></div><div class="gmail_extra"> struct MetricsPartition</div><div class="gmail_extra"> {</div><div class="gmail_extra">
T metricData;</div><div class="gmail_extra"> ...</div><div class="gmail_extra"><br></div><div class="gmail_extra">This inner class MetricsPartition doesn't get identitifed as a template class by getDescribeClassTemplate(). The code I'd used for that identification was:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"> bool VisitCXXRecordDecl( CXXRecordDecl * r )</div><div class="gmail_extra"> {</div><div class="gmail_extra"> if ( r && r->getDescribedClassTemplate() )</div>
<div class="gmail_extra"> {</div><div class="gmail_extra"> r = r->getInstantiatedFromMemberClass() ;</div><div class="gmail_extra"> }</div><div class="gmail_extra"><br></div><div class="gmail_extra"> if ( r && r->isThisDeclarationADefinition() )</div>
<div class="gmail_extra"> {</div><div class="gmail_extra"><br></div><div class="gmail_extra">This code properly identifies the outer class as a template class, but not the inner, perhaps because the template nature of that class is implicit. Is there a way to identify such an implicit template class as such (or perhaps just identify some way that this class has dependent members (without finding out the hard way with the abort)).</div>
<div><br></div></div>-- <br>Peeter
</div></div>