[PATCH] Emit diagnostic on illegal calling convention

John McCall rjmccall at apple.com
Wed Apr 10 12:40:04 PDT 2013

On Apr 8, 2013, at 3:06 PM, Alexander Zinenko <ftynse at gmail.com> wrote:
> Sure, this code should belong to SemaDeclAttr. It required several not very elegant changes to make it work correctly in some places.
> I also removed 'if'-ed dyn_cast to FieldDecl used just to get type since it is inherited from ValueDecl and should be covered in the previous 'if'.

Mmm.  We generally handle this as a type attribute, not a decl attribute, so I think you probably need to handle it in SemaType.  This will let you handle things like variables declared as pointers to __thiscall functions.  It should just be a matter of looking at the immediate declarator context when applying the attribute (and inelegantly repeating some small amount of analysis about CurContext and 'static' and so forth).


More information about the cfe-commits mailing list