r181627 - Avoid patching storage class for block scope thread_local variables.

Enea Zaffanella zaffanella at cs.unipr.it
Wed May 15 06:17:49 PDT 2013


On 05/14/2013 10:21 PM, Richard Smith wrote:
> The call to hasExternalFormalLinkage in CGDecl.cpp should be to
> hasExternalStorage. Consider:
>
> namespace {
>    int a;
>
>    int f() {
>      extern int a;
>      return a;
>    }
> }
>
> Here, the 'a' inside 'f' has InternalLinkage but ExternalStorage. We
> definitely don't want to emit that as an automatic-storage-duration
> variable. Please also add an assert(D.hasLocalStorage()) before the call
> to EmitAutoVarDecl.


Done as suggested (added both testcases).

Enea.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR15991-fix-2.patch
Type: text/x-diff
Size: 1685 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130515/d3fe8a8b/attachment.patch>


More information about the cfe-commits mailing list