D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21628 - The padding bits of bitfields could be calculated automatically
Summary: The padding bits of bitfields could be calculated automatically
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2021-02-11 07:22 UTC by Berni44
Modified: 2021-02-12 07:09 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Berni44 2021-02-11 07:22:30 UTC
struct A
{
    mixin(bitfields!(
        bool, "flag1",    1,
        bool, "flag2",    1));
}

could be treated as if it were

struct A
{
    mixin(bitfields!(
        bool, "flag1",    1,
        bool, "flag2",    1,
        uint, "",         6));
}
Comment 1 Dlang Bot 2021-02-11 07:28:14 UTC
@berni44 created dlang/phobos pull request #7787 "Fix Issue 21628 - The padding bits of bitfields could be calculated automatically" fixing this issue:

- Fix Issue 21628 - The padding bits of bitfields could be calculated automatically

https://github.com/dlang/phobos/pull/7787