https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89601
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org --- Comment #3 from janus at gcc dot gnu.org --- Draft patch to get rid of the ICE: diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 31c7fb6325c..ce9c1e1b090 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -10223,7 +10223,8 @@ gfc_match_derived_decl (void) gfc_error_recovery (); gfc_error_now ("Garbage after PARAMETERIZED TYPE declaration at %C"); } - sym->attr.pdt_template = 1; + if (sym->formal) + sym->attr.pdt_template = 1; } if (extended && !sym->components) With this patch one gets a (correct) error on the test case: $ gfortran-9 c0.f90 c0.f90:8:34: 8 | procedure (ul), pointer :: pj | 1 Error: Argument ‘ki’ of ‘pj’ with PASS(ki) at (1) must be of the derived type ‘q8’ The test case can be cured by adding NOPASS to the PPC declaration.