https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85662

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-05-05
                 CC|                            |jakub at gcc dot gnu.org
            Version|unknown                     |8.0
   Target Milestone|---                         |8.2
            Summary|regression since 6: "error: |[8/9 Regression] "error:
                   |non-constant condition for  |non-constant condition for
                   |static assertion" from      |static assertion" from
                   |__builtin_offsetof in C++   |__builtin_offsetof in C++
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Weird, I can only reproduce it starting with r247495 and can't reproduce with
gcc 7.
Better testcase that doesn't really depend on the actual structure layout and
sizes:
struct S { unsigned long x[31]; };
struct T { bool b; S f; };
static_assert (__builtin_offsetof (T, f.x[31 - 1]) == __builtin_offsetof (T,
f.x[30]), "");
Using 30 instead of 31-1 makes it go away, and the problem is that something
creates or keeps around 8 as pointer constant.

Reply via email to