Skip to content

Bitfield with 64 bits always zero #18247

@dlangBugzillaToGithub

Description

@dlangBugzillaToGithub

Tim reported this on 2024-06-16T17:10:00Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=24613

Description

Values for a bitfield with 64 bits are not stored and remain 0.
```
struct S
{
    ulong a:64;
}

void main()
{
    S s;
    s.a = 1;
    assert(s.a == 1); // Fails: s.a is 0
}
```

This affects both ImportC and normal D with -preview=bitfields.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions