Fix for sizeof bitsize combination (#10227)

* fix #10082

* added test
This commit is contained in:
Arne Döring 2019-01-07 18:09:57 +01:00 • committed by GitHub
commit abad758a7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View file

@ -402,6 +402,18 @@ type
assert sizeof(C) == 3
type
MixedBitsize = object {.packed.}
a: uint32
b {.bitsize: 8.}: uint8
c {.bitsize: 1.}: uint8
d {.bitsize: 7.}: uint8
e {.bitsize: 16.}: uint16
f: uint32
doAssert sizeof(MixedBitsize) == 12
if failed:
quit("FAIL")
else: