https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77418
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2016-08-31 00:00:00 | --- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> --- Wording from 22-007: "19.5.1.6 Construct association "Execution of a SELECT RANK or SELECT TYPE statement establishes an association between the selector and the associate name of the construct. Execution of an ASSOCIATE or CHANGE TEAM statement establishes an association between each selector and the corresponding associate name of the construct. In an ASSOCIATE or SELECT TYPE construct, the following rules apply. • If a selector is allocatable, it shall be allocated; the associate name is associated with the data object and does not have the ALLOCATABLE attribute. • If a selector has the POINTER attribute, it shall be associated; the associate name is associated with the target of the pointer and does not have the POINTER attribute." * * * The code in match.cc's select_type_set_tmp does: sym->attr.pointer = CLASS_DATA (selector)->attr.class_pointer; Note that there is no 'sym->attr.allocatable. Hence: * if (allocated(x)) - is correctly rejected :-) * if (associated (x)) is wrong accepted for pointers :-( * allocate(x)/deallocate(x) - is wrongly accepted for both pointers and allocatables