The following invalid code snippet triggers an ICE since GCC 4.0.0:

=========================================
struct A
{
  A operator[] (int);
};

struct B
{
  A a;
};

void foo()
{
  __builtin_offsetof(B, a[0]);
}
=========================================

bug.cc: In function 'void foo()':
bug.cc:13: internal compiler error: in fold_offsetof_1, at c-common.c:6850
Please submit a full bug report, [etc.]

Before, the code was rejected as __builtin_offsetof was not yet supported.

The problem is related to PR28573.


-- 
           Summary: [4.1/4.2/4.3/4.4 regression] ICE with invalid use of
                    __builtin_offsetof
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
 BugsThisDependsOn: 28573


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35321

Reply via email to