Type definitions should be allowed inside of the offsetof type (original) (raw)
Clang does not accept type definitions inside of the type provided to offsetof. However, I don't see any wording which forbids this. Here is an example program (Clang 16 and newer don't seem to accept this):
#include<stddef.h> int main(void){ offsetof(struct{int a;},a); }
There was a proposal (N2350) which added some text to make this UB, but that has been changed since by DE-137 (N3148) which removes this restriction and only makes it UB if there is an unparenthesized comma inside of offsetof. N3167 includes discussion about accepting DE-137.