I just came across a small issue with the ASSOCIATE construct
If you associate to a field within a type which originally had the TARGET attribute, you can no longer assign a pointer to the field through the associated variable. See my small example below.
I believe, this code should be legal, but I haven't really studied the F2003 specification on that issue.
I'm using IVF11.0.65
best regards,
Thomas
[fortran] program AssociateTargetProb implicit none ! Variables TYPE TypeA REAL :: Val END TYPE Type(TypeA), TARGET :: AType REAL, POINTER :: ARealPtr ! Body ARealPtr => AType%Val ASSOCIATE ( A => AType%Val ) ARealPtr => A END ASSOCIATE end program [/fortran]
链接已复制
3 回复数
I think this should be legal too. The standard says: "The associating entity has the ASYNCHRONOUS, TARGET, or VOLATILE attribute if and only if the selector is a variable and has the attribute." [8.1.4.3] The definition of "variable" in section 6 includes "structure-component". Lastly, 5.1.2.14 says "If an object has the TARGET attribute. then all of its nonpointer subobjects also have the TARGET attribute."
I will report this to the developers. Issue ID is DPD200158406.
I will report this to the developers. Issue ID is DPD200158406.
