[cfe-dev] prefixed gnu style attributes are ignored on tag types

Michael Han Michael.Han at autodesk.com
Mon Dec 13 01:32:56 PST 2010


Greetings,

It looks like clang parser ignores gnu style attributes prefixed on the tag types. For example (assume attr is an implementation defined attribute):

class __attribute__((attr)) foo ; // works

__attribute__((attr)) class foo; // doesn't work; the attribute is parsed while parsing declaration specifiers but doesn't get merged into the attribute list while parsing the class specifier. So the attribute never makes to Sema.

I am wondering why the parser ignores the prefixed attributes. Is this for gcc compatibility? (from http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html#Type-Attributes, it looks like prefixed attribute is not one of the "legal" syntax of gcc type attributes).

Cheers
~Michael

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101213/ba5db82b/attachment.html>


More information about the cfe-dev mailing list