[cfe-dev] [PATCH] extend __interface support

Eli Friedman eli.friedman at gmail.com
Mon Aug 13 00:11:41 PDT 2012


On Sun, Aug 12, 2012 at 11:50 PM, David Robins <llvm at davidrobins.net> wrote:
> Please find attached a patch that extends the support for the
> Microsoft-specific __interface keyword, currently supported as an alias
> for struct. I do not have commit access, and if this were to be accepted
> I would need someone to commit it for me.
>
> This patch adds the semantics of making all member functions defined in
> the interface into pure virtuals, as MSVC does
> (http://msdn.microsoft.com/en-us/library/50h7kwtb%28v=vs.100%29.aspx).
>
> It is implemented as a keyword which translates to struct with a new
> MS-specific attribute "ms_interface", which causes member functions to
> be set to pure virtual (it is not an error to declare either on top of
> the automatic setting; additional pure/virtual specifiers are ignored as
> in MSVC).
>
> The MicrosoftExtension.cpp test is also updated to do an override of a
> base interface method not explicitly declared virtual, which would fail
> without this change.
>
> Thank you for your comments/consideration.

Do clang's diagnostics with your patch match MSVC's diagnostics for
examples like the following?

__interface X;
struct X;
__interface Y;
class Y;

It looks like your patch has a few lines which run over 80 columns.

-Eli



More information about the cfe-dev mailing list