[cfe-dev] [PATCH] extend __interface support

John McCall rjmccall at apple.com
Tue Aug 14 10:01:01 PDT 2012


On Aug 13, 2012, at 12:39 AM, John McCall wrote:
> Is this implicitly an answer to my previous message?

David pointed out that I am apparently losing messages, which is worrisome.
I'll grab your last response via the web archives.

> On Mon, Aug 13, 2012 at 12:39:05AM -0700, John McCall wrote:
> > 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.
> 
> I answered the questions ("can you write...") in a reply to your message
> in the previous thread.
> 
> You said in a previous message to João Matos:
> 
> > Thanks.  In that case, I definitely don't think we want to model this with
> > macros and attributes * MSVC is clearly treating __interface as a fourth
> > kind of class-key, and that's the appropriate way to model it.
> 
> I'm happy to rework the patch; but if you have the time could you
> explain the difference? By "fourth kind of class-key" (I understand
> class-key from the C++ spec) do you mean that it should have its own
> decl spec type TST_interface and TagTypeKind TTK_Interface rather than
> the ms_interface attribute?

Yeah, that's what I was suggesting.  That lets arbitrary clients remember
the exact intent a little easier.

> Note that MS diagnostics refer to __interface as 'struct', e.g.
> 
> 	int.cpp(4) : warning C4099: 'Y' : type name first seen using 'struct'
> 	now seen using 'class'
> 
> Does that matter at all?

That's interesting.  Maybe MSVC just defines this as a macro?  Have you tried
running it through the preprocessor?  Although it's more likely that they're
just being lazy about their diagnostics.

John.



More information about the cfe-dev mailing list