Skip to content

Conversation

@9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Nov 13, 2013

https://d.puremagic.com/issues/show_bug.cgi?id=11510

Implementing issue 11510 will also fix:
Issue 11427 - anonymous unions break structs in @safe code.

And this is necessary compiler enhancement to fix 2.064 regression properly:
Issue 11504 - [CTFE] JSONValue cannot make in CTFE

@9rnsr
Copy link
Contributor Author

9rnsr commented Nov 14, 2013

@andralex How about the proposed semantics in issue 11510?
@donc How is this as a way to handle overlapped fields in CTFE?

@DmitryOlshansky
Copy link
Member

See also this old bug:
https://d.puremagic.com/issues/show_bug.cgi?id=6439

@9rnsr
Copy link
Contributor Author

9rnsr commented Nov 16, 2013

@blackwhale bug 6439 does not occur from 2.064. I opened #2778 for that.

@MartinNowak
Copy link
Member

Looks like this would allow tagged unions in CTFE, right?
If so it's an important enhancement, but I'm lacking the time to review this.
@donc

@9rnsr
Copy link
Contributor Author

9rnsr commented Dec 14, 2013

@MartinNowak That's right. During CTFE, just only one of the overlapped fields would be filled, and if other unassigned fields are accessed, it will cause CTFE interpretation error.

Perhaps this is the most better design so it would be final move.
…ss in safe code/during CTFE

Check overlapped field default initializations immediately after the struct size is determined.
WalterBright added a commit that referenced this pull request Dec 16, 2013
Issue 11510 - Relax restriction for overlapped pointer field access in safe code/during CTFE
@WalterBright WalterBright merged commit 475c543 into dlang:master Dec 16, 2013
@MartinNowak
Copy link
Member

Damn, my review point got lost because I added them to an old commit.
9rnsr@6ec2d8b

@9rnsr
Copy link
Contributor Author

9rnsr commented Dec 17, 2013

@MartinNowak No problem. I replied to your review comments.

@9rnsr 9rnsr deleted the fix11510 branch December 18, 2013 00:09
@ccverg
Copy link

ccverg commented Dec 29, 2013

@9rnsr you should go claim the bounty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants