c2->ts = c1->ts;
c2->attr = c1->attr;
+ if (c1->tb)
+ {
+ c2->tb = gfc_get_tbp ();
+ c2->tb = c1->tb;
+ }
/* The order of declaration of the type_specs might not be the
same as that of the components. */
c2->ts.kind, gfc_basic_typename (c2->ts.type));
goto error_return;
}
+ if (c2->attr.proc_pointer && c2->attr.function
+ && c1->ts.interface && c1->ts.interface->ts.kind == 0)
+ {
+ c2->ts.interface = gfc_new_symbol ("", gfc_current_ns);
+ c2->ts.interface->result = c2->ts.interface;
+ c2->ts.interface->ts = c2->ts;
+ c2->ts.interface->attr.flavor = FL_PROCEDURE;
+ c2->ts.interface->attr.function = 1;
+ c2->attr.function = 1;
+ c2->attr.if_source = IFSRC_UNKNOWN;
+ }
}
/* Similarly, set the string length if parameterized. */
*c->tb = *tb;
}
+ if (saved_kind_expr)
+ c->kind_expr = gfc_copy_expr (saved_kind_expr);
+
/* Set interface. */
if (proc_if != NULL)
{
}
gfc_typebound_proc;
+#define gfc_get_tbp() XCNEW (gfc_typebound_proc)
/* Symbol nodes. These are important things. They are what the
standard refers to as "entities". The possibly multiple names that
--- /dev/null
+! { dg-do run )
+!
+! Test the fix for PR89707 in which the procedure pointer component
+! with a parameterized KIND expression caused an ICE in resolution.
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+!
+program pdt_with_ppc
+ integer, parameter :: kt = kind (0d0)
+ type :: q(k)
+ integer, kind :: k = 4
+ procedure (real(kind=kt)), pointer, nopass :: p
+ end type
+ type (q(kt)) :: x
+ x%p => foo
+ if (int (x%p(2d0)) /= 4) stop 1
+ x%p => bar
+ if (int (x%p(2d0, 4d0)) /= 16) stop 2
+contains
+ real(kind=kt) function foo (x)
+ real(kind = kt) :: x
+ foo = 2.0 * x
+ end
+ real(kind=kt) function bar (x, y)
+ real(kind = kt) :: x, y
+ bar = x ** y
+ end
+end