mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The `-Winvalid-offsetof` warning is valid in this case. `offsetof` is being applied to types with a non-standard layout. The layout of this type is undefined by the specification. There is no guarantee that the type layout is uniform across all ABIs. It is not possible to portably compute the offset statically, especially efficiently. Sink this check into a unit test to avoid performing this test at runtime. In order to do this in the standard library, we would need to do this check through a global constructor.
5.3 KiB
5.3 KiB