Hi Pe<span></span>eter,<div><br></div><div dir="ltr">Glad it worked, but I wonder if you could get away with just <font><span style="line-height:normal;background-color:rgba(255,255,255,0)">hasUserDeclaredConstructor? As far as I understand it, that should be the same as what you're doing below, if you're only interested in existence.</span></font></div>
<div dir="ltr"><font><span style="line-height:normal"><br></span></font></div><div dir="ltr"><font><span style="line-height:normal">I would trust Eli more than I trust myself, though, so take this with a grain of salt.<br>
</span></font><br>- Kim</div><div dir="ltr"><span></span><br>On Tuesday, December 11, 2012, Peeter Joot  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks Kim, that worked nicely:<div><br></div><div><div>         for ( CXXRecordDecl::ctor_iterator b = r->ctor_begin(), e = r->ctor_end() ;</div><div>               b != e ; ++b )</div><div>         {</div><div>            if ( !b->isImplicitlyDefined() )</div>


<div>            {</div><div>               cout << r->getName().str() << " : CONSTRUCTOR" << endl ;</div><div><br></div><div>               break ;</div><div>            }</div><div>         }</div>


<div><br></div></div><div>and is much cleaner.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Peeter<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



CXXRecordDecl has a ctor_begin/ctor_end pair, which return iterators<br>
over all constructors.<br>
<br>
They are of type CXXConstructorDecl, and that class in turn has an<br>
isImplicitlyDefined method you can use to check whether it's<br>
user-written or not.<br>
<br>
You should be able to loop over the RecordDecl's constructors and<br>
count the ones not implicitly defined.<br>
<br></blockquote><div> </div></div>
</div>
</blockquote></div>