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

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-07-25T09:47:00Z
Last change time
2012-07-28T13:32:55Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
destructionator

Comments

Comment #0 by destructionator — 2012-07-25T09:47:01Z
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 by dmitry.olsh — 2012-07-27T15:22:38Z
Thanks for filing this. I've hit similar issue with my project but failed to narrow it down.
Comment #2 by k.hara.pg — 2012-07-28T03:34:15Z
Comment #3 by github-bugzilla — 2012-07-28T13:12:38Z
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 by destructionator — 2012-07-28T13:32:55Z
I'm going to mark this fixed. dmd from git now compiles my original project without problem.