fixes and changes the recently introduced 'alignas' to be 'align' (#12666)
* fixes and changes the recently introduced 'alignas' to be 'align' * more improvements
This commit is contained in:
parent
9c46526cfa
commit
58f3e07b1a
9 changed files with 50 additions and 44 deletions
|
|
@ -336,10 +336,10 @@ testinstance:
|
|||
a: int32
|
||||
b: T
|
||||
|
||||
# this type mixes `packed` with `alignas`.
|
||||
# this type mixes `packed` with `align`.
|
||||
MyCustomAlignPackedObject {.objectconfig.} = object
|
||||
a: char
|
||||
b {.alignas: 32.}: int32 # alignas overrides `packed` for this field.
|
||||
b {.align: 32.}: int32 # align overrides `packed` for this field.
|
||||
c: char
|
||||
d: int32 # unaligned
|
||||
|
||||
|
|
@ -496,11 +496,11 @@ type
|
|||
|
||||
MyCustomAlignUnion {.union.} = object
|
||||
c: char
|
||||
a {.alignas: 32.}: int
|
||||
a {.align: 32.}: int
|
||||
|
||||
MyCustomAlignObject = object
|
||||
c: char
|
||||
a {.alignas: 32.}: int
|
||||
a {.align: 32.}: int
|
||||
|
||||
doAssert sizeof(MyUnionType) == 4
|
||||
doAssert sizeof(MyCustomAlignUnion) == 32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue