Don't patch the storage class of static data members

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Apr 4 13:50:33 PDT 2013


>    // 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.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 2242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130404/c5b1f45e/attachment.obj>


More information about the cfe-commits mailing list