Skip to content

Commit

Permalink
fix Issue 3243 - instantiated 'static this()' bring on a compiler mes…
Browse files Browse the repository at this point in the history
…sage ': __gate is thread local'
  • Loading branch information
9rnsr committed Aug 30, 2015
1 parent f18fe22 commit 01979b0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/tocsym.c
Expand Up @@ -167,7 +167,7 @@ Symbol *toSymbol(Dsymbol *s)

if (vd->isDataseg())
{
if (vd->isThreadlocal())
if (vd->isThreadlocal() && !(vd->storage_class & STCtemp))
{
/* Thread local storage
*/
Expand Down
19 changes: 19 additions & 0 deletions test/compilable/diag3243.d
@@ -0,0 +1,19 @@
// REQUIRED_ARGS: -vtls
// PERMUTE_ARGS:
/*
TEST_OUTPUT:
---
---
*/

template T()
{
static this() {}
}

class C
{
alias ti = T!();
}

void main() {}

0 comments on commit 01979b0

Please sign in to comment.