[cfe-dev] [PATCH] extend __interface support

John McCall rjmccall at apple.com
Mon Aug 13 00:39:05 PDT 2012


On Aug 12, 2012, at 11:50 PM, David Robins 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.

Is this implicitly an answer to my previous message?  That is, are you
saying that __interface cannot be used in elaborated type specifiers?
Please do test this;  the right way to model this feature depends on
how it fits in the language.

John.



More information about the cfe-dev mailing list