[cfe-commits] [PATCH] Warn on duplicate const specifier
Chandler Carruth
chandlerc at google.com
Tue Aug 28 12:06:04 PDT 2012
I'm a bit uncomfortable making this an ExtWarn in all cases, as it doesn't
seem like it should be controlled by -pedantic when it is pedantically well
formed code.
We should probably have two (yea, I know) diagnostics, one for when we
accept this an an extension, and one for when it is valid but likely
confusing / inadvisable. I'm happy for them to both be under the same
diagnostic group though.
On Tue, Aug 28, 2012 at 12:00 PM, Aaron Ballman <aaron at aaronballman.com>wrote:
> This patch addresses PR13705 by turning the extension diagnostic into
> its own warning group (-Wduplicate-decl-specifiers). This helps
> programmers catch const problems with code that likely doesn't behave
> the way they expect it to.
>
> This causes the following to warn, even though it's legal (depending
> on what spec you're compiling against):
>
> const char const *x;
>
> ~Aaron
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120828/94b6a10e/attachment.html>
More information about the cfe-commits
mailing list