https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54322
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid --- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> --- The problem is: copy_ts_from_selector_to_associate (gfc_expr *associate, gfc_expr *selector) which has: if (selector->ts.type == BT_CLASS) { /* The correct class container has to be available. */ assoc_sym->ts.type = BT_CLASS; assoc_sym->ts.u.derived = CLASS_DATA (selector) ? CLASS_DATA (selector)->ts.u.derived : selector->ts.u.derived; assoc_sym->attr.pointer = 1; gfc_build_class_symbol (&assoc_sym->ts, &assoc_sym->attr, &assoc_sym->as); } The latter sets pointer = 1 – such that 'AN' wrongly has the pointer attribute but it does not have the allocate attribute. Thus, also: select type ( AN => pc_alloc ) class is ( POINT ) if (.not. allocated (an)) error stop fails.