[Issue 19667] .offsetof cannot be used on non-public members of aggregates in different modules

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 27 18:51:51 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=19667

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dkorpel at live.nl
         Resolution|---                         |INVALID

--- Comment #2 from Dennis <dkorpel at live.nl> ---
Access checks can be circumvented with __traits(getMember) and tupleof for
meta-programming purposes. `S.privateField` fails the access check before
`.offsetof` is queried on that. Making `.offsetof` undo the access check of its
operand is more hacky than using existing methods.

--


More information about the Digitalmars-d-bugs mailing list