https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99138
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
Keywords| |ice-on-valid-code
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Confirmed – with 'class(*), allocatable :: f(:)' it should be valid (with prior
assignment).
The problem is in gfc_match_rvalue:
3737 if (sym->ts.type == BT_CLASS && sym->attr.class_ok
3738 && CLASS_DATA (sym)->as)
without submodules, we have:
sym->ts.u.derived->components->as
which is working (and either NULL in the original example or != NULL with my
modification).
However, with submodules,
sym->ts.u.derived->components
is NULL, i.e. 'sym->ts.u.derived' (name = "STAR") does not have any
scomponents, but it should have two, _data and _vptr!