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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
The C++ FE does

  if (flag_pack_struct)
    {
      tree v;
      TYPE_PACKED (t) = 1;
      /* Even though the type is being defined for the first time
         here, there might have been a forward declaration, so there
         might be cv-qualified variants of T.  */
      for (v = TYPE_NEXT_VARIANT (t); v; v = TYPE_NEXT_VARIANT (v))
        TYPE_PACKED (v) = 1;
    }

Maybe starting with TYPE_MAIN_VARIANT will fix this (for no obvious reason)

Reply via email to