[cfe-dev] Visual C++ __interface keyword

David Robins llvm at davidrobins.net
Sun Aug 12 14:11:50 PDT 2012


I'm running into problems compiling code that uses the
Microsoft-specific __interface keyword. Although it's been implemented
in clang as an alias for struct, it's missing the automatic pure virtual
specifier for member functions that is implied by the keyword.

I understand that implementing MS-specific keywords likely isn't high on
anyone's list, and was hoping to be able to make the change myself if it
is something that would be accepted as a patch (provided it conforms to
the coding standards, has tests, etc.; I have read the internals/hacking
pages).

While not new to compilers generally I'm new to clang, so pointers for
this task would be appreciated. As I see it I first have to upgrade
__interface to a keyword in TokenKinds.def so it can be appropriately
detected at higher levels (and still mostly treated as a struct) -
perhaps set a flag in CXXRecordDecl, and apply the pure/virtual
specifiers when a method within the interface is parsed?



More information about the cfe-dev mailing list