[cfe-commits] [Patch] Fix for r163013 regression and further __interface enhancement

Andy Gibbs andyg1001 at hotmail.co.uk
Wed Sep 12 11:26:36 PDT 2012


On Wednesday, September 12, 2012 6:26 PM, John McCall wrote:
  On Sep 12, 2012, at 4:24 AM, Richard Smith wrote:
    On Wed, Sep 12, 2012 at 2:08 AM, Andy Gibbs <andyg1001 at hotmail.co.uk> wrote:

      Hi,

      Attached are two patches to complement the recent work done by David Robins on __interface.

      The first, interface-fix.diff, corrects a codegen regression created by r163013 whereby all methods (including constructors) inside an __interface were being marked pure virtual and were causing the vtable generation to be invalid.



    Applying this to operators doesn't seem correct, since an __interface shouldn't have any operators in the first place.  Also, getOverloadedOperator doesn't check for conversion operators.


  Presumably it gets the implicit copy/move assignment operators, which should definitely not be virtual.


  Oh, and could someone check whether __interface implicitly declares a virtual destructor?  That seems like a possibility.


  John. 
That's right, but as Richard pointed out, if the two patches are combined, it is enough to check if the method is user-provided (since user-provided constructors, destructors and operators are not allowed).

Attached here is the patch that incorporates Richard's comments.  Since the fix is dependent on the enhancement, I've rolled it now into one patch.  I've also implemented a diagnostic message on "private:" or "protected:" appearing inside the __interface as MSVC does give a diagnostic here too.

Cheers
Andy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120912/d5f0a72f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interface-enh.diff
Type: application/octet-stream
Size: 27858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120912/d5f0a72f/attachment.obj>


More information about the cfe-commits mailing list