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

--- Comment #6 from Paul Thomas <pault at gcc dot gnu.org> ---

> From F2017: 15.5.2.5
> The actual argument shall be polymorphic if and only if the associated dummy
> argument is polymorphic, and either both the actual and dummy arguments
> shall be unlimited polymorphic, or the declared type of the actual argument
> shall be the same as the declared type of the dummy argument.
> 
> As yet, I have not found the constraints leading to the second error.
> 
> Cheers
> 
> Paul

Sorry, cancel that.
>From 7.3.2.2:
.....
3 An entity that is declared using the TYPE(*) type specifier is assumed-type
and is an unlimited polymorphic entity.....

This fixes the problem (my trans-expr.c has a rather substantial patch applied
at the moment):
        case BT_CLASS:
          if (UNLIMITED_POLY (e))       // Compatible with TYPE(*)
            {
               itype = CFI_type_other;  // FIXME: Or CFI_type_cptr ?
               break;
            }
          else
            gcc_unreachable ();
        case BT_PROCEDURE:
        case BT_HOLLERITH:
        case BT_UNION:
        case BT_BOZ:
        case BT_UNKNOWN:
          // FIXME: Really unreachable? Or reachable for type(*) ? If so,
CFI_type_other?
          gcc_unreachable (); // This is where the ICE occurred.

Reply via email to