Summary: | [OOP] Wrong TARGET-attribute handling with CLASS IS/TYPE IS | ||
---|---|---|---|
Product: | gcc | Reporter: | Tobias Burnus <burnus> |
Component: | fortran | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | normal | CC: | janus |
Priority: | P3 | Keywords: | accepts-invalid, diagnostic, rejects-valid |
Version: | 4.8.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2015-10-13 00:00:00 |
Description
Tobias Burnus
2012-08-19 15:33:49 UTC
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. |