Skip to content

Commit

Permalink
Merge pull request #3802 from ibuclaw/bug145
Browse files Browse the repository at this point in the history
[2.066b] Issue 13194 - ICE when initializing static class members to void
  • Loading branch information
9rnsr committed Jul 23, 2014
2 parents f740f0d + 68f4f8c commit b4335c9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/declaration.c
Expand Up @@ -1753,10 +1753,10 @@ void VarDeclaration::semantic2(Scope *sc)
}
else if (init && isThreadlocal())
{
if ((type->ty == Tclass)&&type->isMutable()&&!type->isShared())
if ((type->ty == Tclass) && type->isMutable() && !type->isShared())
{
ExpInitializer *ei = init->isExpInitializer();
if (ei->exp->op == TOKclassreference)
if (ei && ei->exp->op == TOKclassreference)
error("is mutable. Only const or immutable class thread local variable are allowed, not %s", type->toChars());
}
else if (type->ty == Tpointer && type->nextOf()->ty == Tstruct && type->nextOf()->isMutable() &&!type->nextOf()->isShared())
Expand Down
17 changes: 17 additions & 0 deletions test/compilable/test13194.d
@@ -0,0 +1,17 @@
module test13194;

class C13194
{
static Object o = void;
}

struct S13194
{
static Object o = void;
}

union U13194
{
static Object o = void;
}

0 comments on commit b4335c9

Please sign in to comment.