gccgo: fails to reject unsafe.Offsetof(*&(s.f)) #40291
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
This source code is rejected by cmd/compile and go/types, but prints 0 when run using gccgo:
It seems like gccgo is optimizing
*&(s.f)
to(s.f)
before checking that the argument tounsafe.Offsetof
is well formed./cc @ianlancetaylor
Edit: I think the same issue affects
unsafe.Alignof
too.The text was updated successfully, but these errors were encountered: