[cfe-commits] [PATCH] Improve Clang diagnostic on ignored GNU type attributes

Eli Friedman eli.friedman at gmail.com
Mon Dec 12 11:44:58 PST 2011


On Sun, Dec 11, 2011 at 3:25 PM, Michael Han <Michael.Han at autodesk.com> wrote:
> Hi,
>
>
>
> This patch improves Clang diagnostic to warn about ignored GNU type
> attributes in declaration specifiers, such as ““__attribute__((aligned))
> struct foo”, where the attribute should (according to GCC attribute syntax
> and implementation) be placed after the tag to apply to the type
> declaration.
>
>
>
> Please review, thanks!

+        if (attrs->isCXX0XAttribute()) continue;

Why exclude C++11 attributes here?  They have the same issue.

+  }
+
   // FIXME: Warn on useless attributes

Might as well get rid of the FIXME, since you're fixing it. :)

Otherwise, looks good!

-Eli




More information about the cfe-commits mailing list