<div dir="ltr">Oddly enough I've been working on this exact area myself over the last few days. I could be overlooking something but it appears to be missing support for the X64 ABI (ie. amd64-pc-win32) which would be a shame not to support. I've previously spent some time analyzing it and came up with the following member function pointer sizes:<div>








<ul class=""><li class="">Single inheritance: 1 x sizeof(void*)</li>
<li class="">Multiple inheritance: 2 x sizeof(void*)</li>
<li class="">Virtual inheritance:</li>
<ul class="">
<li class="">32-bit: 3 x sizeof(void*)</li>
<li class="">64-bit: 2 x sizeof(void*)</li>
</ul>
<li class="">Unknown inheritance:</li>
<ul class="">
<li class="">32-bit: 4 x sizeof(void*)</li>
<li class="">64-bit: 3 x sizeof(void*)</li>
</ul>
</ul><div style>As you can see there's a couple of differences based on the architecture but their pretty minor.</div><div style><br></div><div style>The inheritance keywords should be definitive for the rest of the TU. MSVC will issue an error should the class definition not match the assigned inheritance keyword - this is a useful sanity check and probably worth implementing. The error in question is C2286 and is outlined here: <a href="http://msdn.microsoft.com/en-gb/library/9z8tbhb2.aspx">http://msdn.microsoft.com/en-gb/library/9z8tbhb2.aspx</a></div>
<div style><br></div><div style>In addition, MSVC has a nasty corner case. If a member function pointer is instantiated based on an (as yet) undefined class the class is assigned the unknown inheritance for the rest of the translation unit - even if the class is defined later in the TU. I've been wondering how best to model this persistant state and the only approach I could come up with was to assign a (currently unimplemented) UnknownInheritanceAttr during sema - but it's not pretty.</div>
</div><div style><br></div><div style>Lastly, I haven't had a chance to revisit it, but MSVC seems to do weird things with member function pointer alignment. I know this isn't specific to this patch but I thought I'd mention it. Hopefully I'll get the chance to research it soon and get to the bottom of the implementation.</div>
<div style><br></div><div style>- Will</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 21 March 2013 22:56, Joćo Matos <span dir="ltr"><<a href="mailto:triton@vapor3d.org" target="_blank">triton@vapor3d.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  Patch looks good to me. Hope this is finally fixed :)<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D568" target="_blank">http://llvm-reviews.chandlerc.com/D568</a><br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><span style="background-color:rgb(255,255,255);color:rgb(68,68,68);font-family:Arial,Helvetica,sans-serif"><b>Indefiant Ltd.</b></span></div><div><font color="#444444" face="Arial, Helvetica, sans-serif"><span style="font-size:12px"><b><br>
</b></span></font></div><font color="#444444" face="Arial, Helvetica, sans-serif"><span style="font-size:12px">Firsby Lodge, New Main Road, Scamblesby, Louth, Lincs LN11 9XH UK<br></span></font><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;background-color:rgb(255,255,255)">
<span style="color:rgb(68,68,68);font-family:Arial,Helvetica,sans-serif;font-size:x-small"><i>Tel: +44 20 8123 7663 England Registered No. 07936820 VAT No. </i></span><span style="background-color:transparent"><font color="#444444" face="Arial, Helvetica, sans-serif" size="1"><i>128556202</i></font></span></div>

</div>