Nasty parsing bug?

Abramo Bagnara abramo.bagnara at
Sat Aug 16 01:40:28 PDT 2014

Il 15/08/2014 20:45, Aaron Ballman ha scritto:
> This code should be commented that it's in place to ensure
> compatibility with parsing GNU-style attributes where the attribute is
> on a separate line from the elaborated type specifier.
> We should then have a new test in Sema (gnu-attributes.c?) that does
> something like:
> struct s {};
> // FIXME: should warn that declaration attribute in type position is
> being applied to the declaration instead?
> struct s __attribute__((used)) foo;
> // FIXME: Should warn that type attribute in declaration position is
> being applied to the type instead?
> struct s  *bar __attribute__((address_space(1)));
> // Should not warn because type attribute is in type position.
> struct s *__attribute__((address_space(1))) baz;
> // Should not warn because declaration attribute is in declaration position.
> struct s *quux __attribute__((used));
> We can then expand this file with all of the other insane places you
> can put GNU-style attributes.
> With those changes, LGTM!

Committed in r215814.

Abramo Bagnara

mailto:abramo.bagnara at

More information about the cfe-commits mailing list