...
When specifying the type argument for the offsetof() macro, only pass a standard-layout class. The full description of a standard-layout class can be found in clause 9, paragraph 7, of the C++ Standard, or the type can be checked with the std::is_standard_layout<> type trait. When specifying the member designator argument for the offsetof() macro, do not pass a bit-field, static data member, or function member. Passing an invalid type or member to the offsetof() macro is undefined behavior.
...