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

            Bug ID: 77771
           Summary: internal compiler error: in cxx_eval_bit_field_ref, at
                    cp/constexpr.c:2090
           Product: gcc
           Version: 5.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bruck.michael at googlemail dot com
  Target Milestone: ---

struct S
{
    char        x[2];
    unsigned    y;
};

constexpr bool func(const S s)
{
    return s.x[0] != 42 || s.x[1] != 0;
}

static_assert(!func({{42, 7}, 0}), "bla");

---

Compiled with -std=c++11 -O on various compilers (http://gcc.godbolt.org/)
starting with 4.7.1 up to 7 I get an ICE:

Example with 5.4:
12 : in constexpr expansion of 'func(S{char [2]{'*', '\007'}, 0u})'
12 : internal compiler error: in cxx_eval_bit_field_ref, at cp/constexpr.c:2090
static_assert(!func({{42, 7}, 0}), "bla");

Reply via email to