Question about existing tests for [dcl.stc]

Richard Smith richard at metafoo.co.uk
Mon May 19 14:32:06 PDT 2014


You're citing the wrong section of the standard in your patch. The relevant
wording is [dcl.stc]p1: "If a storage-class-specifier appears in a
decl-specifier-seq, [...] the init-declarator-list of the declaration shall
not be empty [...]."

Do we really need to change the code here? Is the new diagnostic better
than the old one? Do we have a reason to promote this from ExtWarn to Error
just for mutable and not for other storage class specifiers?

On Mon, May 19, 2014 at 2:05 PM, Aaron Ballman <aaron at aaronballman.com>wrote:

> Specific patch to address the problem is attached.
>
> ~Aaron
>
> On Mon, May 19, 2014 at 12:59 PM, Aaron Ballman <aaron at aaronballman.com>
> wrote:
> > We have a test that's XFAILed for everything:
> > test\CXX\dcl.dcl\dcl.spec\dcl.stc\p10.cpp
> >
> > However, I can see no reason why this test should be failed for all
> > platforms. The only issue I see with the test is that the wording for
> > a diagnostic may need to be updated.
> >
> > mutable struct s1 {}; // expected-error{{'mutable' cannot be applied
> > to non-data members}}
> >
> > Could be: 'mutable' is not permitted on a declaration of a type
> >
> > which is what currently fires for that line in the test. However, that
> > is currently fired as an extension warning, not an error, for C++. Am
> > I correct in thinking that warning should be upgraded to an error for
> > C++, the test updated for the new wording, and then the XFAIL can go
> > away?
> >
> > ~Aaron
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140519/e9be3483/attachment.html>


More information about the cfe-commits mailing list