[cfe-commits] [PATCH] Emit Fix-Its for duplicate decl-specifiers.
Jordy Rose
jediknil at belkadan.com
Sat Aug 21 11:54:10 PDT 2010
On Sat, 21 Aug 2010 20:49:49 +0200, Eelis van der Weegen <eelis at eelis.net>
wrote:
> On 2010-08-21 20:01, Jordy Rose wrote:
>>
>> On Sat, 21 Aug 2010 14:21:38 +0200, Eelis van der Weegen
>> <eelis at eelis.net>
>> wrote:
>>> The attached (trivial) patch makes Clang emit Fix-Its that remove
>>> duplicate decl-specifiers (e.g. "const int const x = 3").
>>
>> I think when people type these, it's usually because they meant to make
>> the pointer const too:
>>
>> const char const *p = "abc";
>> // const char * const p = "abc";
>
> Good point! Then maybe the fix-it should only be emitted if there's no
> pointer in the declaration or the duplicate decl-specifier is not a
> cv-qualifier.
>
>> Maybe this shouldn't be a fix-it? (but could be a warning)
>
> There are already warnings for all of these duplicate decl-specifiers.
> Adding fix-its for them just seemed like an easy bonus. :)
>
> Is there a reason we're having this conversation off-list, by the way?
> Is discussion on cfe-commits discouraged?
>
> - Eelis
No! Sorry, I just forgot to hit "Reply All", that's all (cc'd now). And I
forgot that the warnings are already there.
Jordy
More information about the cfe-commits
mailing list