8437 – [2.060 beta] static struct no size yet for forward reference

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8437 - [2.060 beta] static struct no size yet for forward reference
Summary: [2.060 beta] static struct no size yet for forward reference
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
Reported: 2012年07月25日 09:47 UTC by Adam D. Ruppe
Modified: 2012年07月28日 13:32 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Adam D. Ruppe 2012年07月25日 09:47:01 UTC
I just tried the dmd 2.060 beta on my work app and got an error that
wasn't present on 2.059. This is trimmed down as small as I can:
===
class Cgi {
 struct PostParserState {
 UploadedFile piece;
 }
 static struct UploadedFile {
 string contentFilename;
 }
}
===
$ dmd -c regression.d
regression.d(6): Error: struct regression.Cgi.UploadedFile no size yet for forward reference
If I take the static off of UploadedFile, the error goes away. Or
I can swap the order of the definitions and the error goes away, but
it used to work the way it is.
Comment 1 Dmitry Olshansky 2012年07月27日 15:22:38 UTC
Thanks for filing this. I've hit similar issue with my project but failed to narrow it down.
Comment 2 Kenji Hara 2012年07月28日 03:34:15 UTC
https://github.com/D-Programming-Language/dmd/pull/1067 
Comment 3 github-bugzilla 2012年07月28日 13:12:38 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/98467f4202d7bca6abd18cc28a51e95a0bc57100
fix Issue 8437 - [2.060 beta] static struct no size yet for forward reference
This is a regression introduced fixing aggregate alignment.
Introduced Commit: 154e44a006270d53745f99ec3e538a0ce526ae76
In VarDeclaration::semantic, if scope alignment is default, then its type's alignment is used, and it needs to resolve forward reference.
But, in ClassDeclaration::semantic, the calling setScope for AttribDeclaration members was lacked.
https://github.com/D-Programming-Language/dmd/commit/c59699ae29dde0f32239bcadb853c7793ee4bada
Merge pull request #1067 from 9rnsr/fix8437
Issue 8437 - [2.060 beta] static struct no size yet for forward reference
Comment 4 Adam D. Ruppe 2012年07月28日 13:32:55 UTC
I'm going to mark this fixed. dmd from git now compiles my original project without problem.


AltStyle によって変換されたページ (->オリジナル) /