Don't patch the storage class of static data members

Richard Smith richard at metafoo.co.uk
Thu Apr 4 14:16:10 PDT 2013


On Thu, Apr 4, 2013 at 1:50 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com
> wrote:

> >    // C99 6.2.2p4: Check if we have a static decl followed by a
> non-static.
> >    if (New->getStorageClass() == SC_Static &&
> > -      (Old->getStorageClass() == SC_None || Old->hasExternalStorage()))
> {
> > +      !New->isStaticDataMember() &&
> > +      isExternalLinkage(Old->getLinkage())) {
> >
> > This looks backwards -- is the comment here wrong? The
> 'isStaticDataMember'
> > check looks like it might be unnecessary, since a redeclaration of a
> static
> > data member can't be marked 'static'.
>
> Good catch. I have updated the comment. The reference also looked
> wrong, at least in the C standard draft that I have, so I have changed
> it to point to the c++ one.
>
> The isStaticDataMember is there to avoid producing duplicated errors
> when a redeclaration has the static storage class.


OK, LGTM.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130404/a36e2a6a/attachment.html>


More information about the cfe-commits mailing list