The following (valid ?) code snippet triggers an ICE since GCC 4.2.0: ========================================= struct A { char c; int& i; };
int j = __builtin_offsetof (A, i); ========================================= bug.cc:7: warning: invalid access to non-static data member 'A::i' of NULL object bug.cc:7: warning: (perhaps the 'offsetof' macro was used incorrectly) bug.cc:7: internal compiler error: in fold_offsetof_1, at c-common.c:6838 Please submit a full bug report, [etc.] -- Summary: [4.2/4.3/4.4 regression] ICE with offsetof and references Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: ice-on-valid-code, monitored Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35741