EXTENDS_TYPE_OF intrinsic function
Standard: F77 F90 F95 F2003 F2008
 Example Program
<Syntax>
EXTENDS_TYPE_OF ( A, MOLD )
A : object of extensible type or CLASS(*);
MOLD : object of extensible type or CLASS(*);

Result : Default Logical scalar.

Both A and MOLD are permitted to be unallocated allocatables or disassociated pointers, but are not permitted to be undefined pointers.
<Semantics>

The result is true if and only if the dynamic type of A is the same as, or an extension of, the dynamic type of MOLD. Note that the dynamic type of unallocated allocatable or disassociated pointer is the same as its declared type; in the case of CLASS(*), which has no declared type, it is treated as if it is the parent type of everything, i.e. everything extends a disassociated CLASS(*) and a disassociated CLASS(*) is not an extension of anything else. Either A or MOLD is CLASS(*) and has a dynamic type that is not extensible, the result is processor dependent.

Note that simply knowing that a type is an extension of another does not give you access to any of the extended components; to do this you need to use the SELECT TYPE construct.

<Related>
CLASS specifier, Derived Type Definition, EXTENDS clause, SAME_TYPE_AS intrinsic function, SELECT TYPE construct