Hi all,

while working at teams stuff I encountered some issue with the ASSOCIATE
statement:

1. First of all: It does not open its namespace as it is expected to. I.e. the
associate-name (referring to the term as used in F2018 11.1.3.1 R1104) is put
into the parent namespace/scope and not into its own (overwriting values
possibly).

2. Doing

associate(me => this_image(), num => num_images(), foo = MOD(me + 43, num))

produces a very unexpected value of foo. If it is computed at all! I got a
SigFPE for a long time, before I figured that the me and num in the expression
of foo are not the ones from the associate, but are not initialized variable of
the parent scope. I therefore worked to resolve this and found one test
(associate_1.f03), that check exactly this (IMO wrong) behavior. Testing with
Intel's latest Fortran compiler, the test fails, too. Intel also allows using
former associate-names in the later expr.

Therefore my question: Why is this implemented that way? When I read F2018
19.6.7 correctly, then it only means that recursive references are not allowed,
i.e. associate( v => f(v) ) or the like. But referencing an associate-name in a
latter expr is fine, because that is not recursive.

Any comments, insight or pointers to why a "defined" associate-name must not
occur in an associate expr, but may occur in an associate immediately
following, are very much appreciated!

Puzzled regards,
        Andre
--
Andre Vehreschild * Email: vehre ad gmx dot de

Reply via email to