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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We're in cxx_eval_store_expression, evaluating <retval> = this, this is while
evaluating a CALL_EXPR allocator::~allocator (&D.4529).  We're on ARM, so
cdtors return this.

init is evaluated to &D.4529 [allocator *], object is <retval> [void *].  Their
types aren't the same so we go to

  if (empty_base || !(same_type_ignoring_top_level_qualifiers_p
                      (TREE_TYPE (init), type)))
    {    
      /* For initialization of an empty base, the original target will be
       *(base*)this, evaluation of which resolves to the object
       argument, which has the derived type rather than the base type.  In
       this situation, just evaluate the initializer and return, since
       there's no actual data to store, and we didn't build a CONSTRUCTOR.  */
      empty_base = true;
      gcc_assert (is_empty_class (TREE_TYPE (init)));

and is_empty_class will always say false for a pointer type -> ICE.  I don't
think we should have gotten into this branch.

Reply via email to