r224012 - Emit warning if define or undef reserved identifier or keyword.

Aaron Ballman aaron at aaronballman.com
Mon Dec 15 10:14:34 PST 2014


On Mon, Dec 15, 2014 at 1:01 PM, Serge Pavlov <sepavloff at gmail.com> wrote:
> Maybe turn this warning off by default? As Nico pointed out, there are
> additional cases:
>
> #define inline _inline

I think this is fine to cover from my suggestions above. _inline is an
extension just the same as __inline is.

> #define final(a,b,c) some_computation(a, b,c )

This *should* warn for modes where final is a keyword because it's
overriding the keyword's behavior.

I am not keen on off-by-default warnings. I think the general rule of
thumb is that if it's not important enough to be on by default, it may
not be important enough to include. Personally, I think this is
borderline, but have a preference to see it remain on by default, with
the proper heuristics.

~Aaron

>
> They are not covered by the rules above.
>
> Thanks,
> --Serge
>
> 2014-12-15 23:45 GMT+06:00 Aaron Ballman <aaron at aaronballman.com>:
>>
>> On Mon, Dec 15, 2014 at 12:11 PM, Serge Pavlov <sepavloff at gmail.com>
>> wrote:
>> > 2014-12-15 22:32 GMT+06:00 Aaron Ballman <aaron at aaronballman.com>:
>> >>
>> >>
>> >> This commit appears to be lacking tests, and I would like to see some
>> >> added for each of the new diagnostics, as well as for cases that
>> >> should be valid (such as keywords in language modes that do not have
>> >> the keyword).
>> >>
>> >>
>> > Test are added in r224100.
>>
>> So they are, thank you for pointing that out!
>>
>> ~Aaron



More information about the cfe-commits mailing list