-
-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[spec/struct] Add 'Union Literals' & 'Anonymous Structs & Unions' #3355
Conversation
|
Thanks for your pull request and interest in making D better, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the text could be more precise in what an anonymous struct/union does instead of what it's used for. It doesn't cover arbitrarily complex / redundant usages: struct S { struct { struct { union { struct { int x; }}}}} Still, it's a good start.
|
@ntrel please update the commit message, so that all of the issues will be automatically closed by @dlang-bot. See: https://github.com/dlang/dlang-bot#referencing-multiple-issues |
|
Hmm, the commit message does contain both issues, I wonder why the bot doesn't catch that. @ntrel the quick fix would be to just break your commit into 2, each fixing one of the issues. |
|
I think the commit message should start with the issues that are fixed. Try this: |
…s & Unions' Fix Issue 21188 - Anonymous structs - not described. Fix Issue 18855 - Behavior of Anonymous Union is Undocumented. Fix: Non-overlapping union field data is not default initialized, it is zeroed.
|
@PetarKirov @RazvanN7 Updated commit message as suggested. No changes to diff. |
|
@PetarKirov Do you know which file in |
I think this is what you're looking for: https://github.com/dlang/dlang-bot/blob/750bb49423033c0bc52d2515fde2b29238668265/source/dlangbot/bugzilla.d#L21 |
The docs for a struct literal with a union field apply for non-anonymous unions too.
Fix: Non-overlapping union field data is not default initialized, it is
zeroed.
Fixes Issues 21188, 18855.