Skip to content

Commit

Permalink
fix Issue 12531 - forward reference with nested struct
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Aug 26, 2014
1 parent 639bcaa commit bda8b04
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/struct.c
Expand Up @@ -172,6 +172,8 @@ void AggregateDeclaration::semantic2(Scope *sc)
if (!members)
return;

if (scope && sizeok == SIZEOKfwd) // Bugzilla 12531
semantic(NULL);
if (scope)
{
error("has forward references");
Expand Down
14 changes: 14 additions & 0 deletions test/compilable/fwdref12531.d
@@ -0,0 +1,14 @@
// PERMUTE_ARGS:

struct Node(T)
{
T _val;
}

void foo()
{
static struct Foo
{
Node!Foo* node;
}
}

0 comments on commit bda8b04

Please sign in to comment.