http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60458
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |janus at gcc dot gnu.org --- Comment #1 from janus at gcc dot gnu.org --- I'm not fully sure if this is valid, but I tend to agree. I think the error you get is supposed to check for C402 in Fortran 2008: C402 (R401) A colon shall not be used as a type-param-value except in the declaration of an entity or component that has the POINTER or ALLOCATABLE attribute. If I prevent it from being triggered here, via this patch ... Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (revision 208386) +++ gcc/fortran/resolve.c (working copy) @@ -10784,7 +10784,8 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag) } /* Constraints on deferred type parameter. */ - if (sym->ts.deferred && !(sym->attr.pointer || sym->attr.allocatable)) + if (sym->ts.deferred && !(sym->attr.pointer || sym->attr.allocatable) + && !sym->attr.associate_var) { gfc_error ("Entity '%s' at %L has a deferred type parameter and " "requires either the pointer or allocatable attribute", ... then I get the following (which looks like a middle-end error): c0.f90: In function ‘test’: c0.f90:13:0: error: size of variable ‘s’ is too large associate(S => this%TestP())