@@ -2898,7 +2898,8 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult
&Previous,
// 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'.
On Thu, Apr 4, 2013 at 11:17 AM, Rafael Espíndola <
[email protected]> wrote:
> This is a bit of patching that survived 178663. Without it we can
> produce better a better error message for
>
> const int a = 5;
> static const int a;
>
> Cheers,
> Rafael
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits