Skip to content

Commit

Permalink
Merge pull request #1067 from 9rnsr/fix8437
Browse files Browse the repository at this point in the history
Issue 8437 - [2.060 beta] static struct no size yet for forward reference
  • Loading branch information
WalterBright committed Jul 28, 2012
2 parents 988414c + 98467f4 commit c59699a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/class.c
Expand Up @@ -640,9 +640,10 @@ void ClassDeclaration::semantic(Scope *sc)
if (s->isEnumDeclaration() ||
(s->isAggregateDeclaration() && s->ident) ||
s->isTemplateMixin() ||
s->isAttribDeclaration() ||
s->isAliasDeclaration())
{
//printf("setScope %s %s\n", s->kind(), s->toChars());
//printf("[%d] setScope %s %s, sc = %p\n", i, s->kind(), s->toChars(), sc);
s->setScope(sc);
}
}
Expand Down
33 changes: 24 additions & 9 deletions test/runnable/xtest46.d
Expand Up @@ -5290,17 +5290,32 @@ struct DT160

void foo160(DT160 dateTime)
{
printf("test7 year %d, day %d\n", dateTime._date._year, dateTime._date._day);
assert(dateTime._date._year == 1999);
assert(dateTime._date._day == 6);
printf("test7 year %d, day %d\n", dateTime._date._year, dateTime._date._day);
assert(dateTime._date._year == 1999);
assert(dateTime._date._day == 6);
}

void test160() {
auto dateTime = DT160(1999, 7, 6, 12, 30, 33);
printf("test5 year %d, day %d\n", dateTime._date._year, dateTime._date._day);
assert(dateTime._date._year == 1999);
assert(dateTime._date._day == 6);
foo160(DT160(1999, 7, 6, 12, 30, 33));
void test160()
{
auto dateTime = DT160(1999, 7, 6, 12, 30, 33);
printf("test5 year %d, day %d\n", dateTime._date._year, dateTime._date._day);
assert(dateTime._date._year == 1999);
assert(dateTime._date._day == 6);
foo160(DT160(1999, 7, 6, 12, 30, 33));
}

/***************************************************/
// 8437

class Cgi8437
{
struct PostParserState {
UploadedFile piece;
}

static struct UploadedFile {
string contentFilename;
}
}

/***************************************************/
Expand Down

0 comments on commit c59699a

Please sign in to comment.