Nasty parsing bug?

Aaron Ballman aaron at aaronballman.com
Sat Aug 16 07:44:15 PDT 2014


On Sat, Aug 16, 2014 at 4:40 AM, Abramo Bagnara
<abramo.bagnara at bugseng.com> wrote:
> 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.

Thanks, looks good!

~Aaron



More information about the cfe-commits mailing list