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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The problem is that:
          if (MAYBE_CLASS_TYPE_P (totype))
            /* Use lookup_fnfields_slot instead of lookup_fnfields to avoid
               creating a garbage BASELINK; constructors can't be inherited. 
*/
            ctors = lookup_fnfields_slot (totype, complete_ctor_identifier);
calls lookup_fnfields_slot with just MAYBE_CLASS_TYPE_P, not CLASS_TYPE_P, but
lookup_fnfields_slot does complete_type, so perhaps that is fine.
Unfortunately the r250440 commit removed the
  if (!CLASS_TYPE_P (type))
    return -1;
part from lookup_fnfields_slot_nolazy that made this work before.
So either we should readd it there (in the form of if (!CLASS_TYPE_P (type))
return NULL_TREE; ), or not call lookup_fnfields_slot_nolazy from
lookup_fnfields_slot like:
-  return lookup_fnfields_slot_nolazy (type, name);
+  if (CLASS_TYPE_P (type))
+    return lookup_fnfields_slot_nolazy (type, name);
+  return NULL_TREE;
(seems other lookup_fnfields_slot_nolazy callers should likely ensure that it
is a CLASS_TYPE_P, either explicitly, or through using types from binfo
accessors).

Reply via email to