https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118346
Simon Martin <simartin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |simartin at gcc dot gnu.org --- Comment #2 from Simon Martin <simartin at gcc dot gnu.org> --- Interesting one! gcc diverges from clang / EDG / MSVC++ when using ((C*)0)->i) => https://godbolt.org/z/EoGxTs5dE but does NOT when using __builtin_offsetof (C, i); => https://godbolt.org/z/7qGjMePMn Looking at the history, the error has been added via r6-5625-g1a161cd7a75453 for bug #68711, and a follow-up (that is specific to __builtin_offsetof) was done via r7-6354-g905d2812e7bd7e for bug #68727. I think that we get exactly what we want (i.e. accept ((C*)0)->i while still rejecting __builtin_offsetof (C, i)) by simply undoing the first commit. This is what I'll be starting from.