Created attachment 25255 [details] just compile it gfortran must allow in a PURE procedure assignment to iterator variable in array constructor
The constraint leading the rejection is the following (C1283) - though having a variable in as ac-do-variable is something different (cf. 16.4). Other compilers also accept the program F2008 for quotes: "C1283 In a pure subprogram any designator with a base object that is in common or accessed by host or use association, is a dummy argument with the INTENT (IN) attribute, is a coindexed object, or an object that is storage associated with any such variable, shall not be used (1) in a variable denition context (16.6.7), (2) as the data-target in a pointer-assignment-stmt, (3) as the expr corresponding to a component with the POINTER attribute in a structure-constructor, (4) as the expr of an intrinsic assignment statement in which the variable is of a derived type if the derived type has a pointer component at any level of component selection, or (5) as an actual argument corresponding to a dummy argument with INTENT (OUT) or INTENT (INOUT) or with the POINTER attribute." "16.4 Statement and construct entities" "A variable that appears as a data-i-do-variable in a DATA statement or an ac-do-variable in an array constructor, as a dummy argument in a statement function statement, or as an index-name in a FORALL statement is a statement entity. A variable that appears as an index-name in a FORALL or DO CONCURRENT or as an associate-name in a SELECT TYPE or ASSOCIATE construct is a construct entity. [...]" "The name of a statement entity shall not be the same as an accessible global identier or local identier of class (1) (16.3.1), except for a common block name or a scalar variable name. Within the scope of a statement entity, another statement entity shall not have the same name." "The name of a data-i-do-variable in a DATA statement or an ac-do-variable in an array constructor has a scope of its data-implied-do or ac-implied-do. It is a scalar variable that has the type and type parameters that it would have if it were the name of a variable in the innermost executable construct or scoping unit that includes the DATA statement or array constructor, and this type shall be integer type; it has no other attributes. The appearance of a name as a data-i-do-variable of an implied DO in a DATA statement or an ac-do-variable in an array constructor is not an implicit declaration of a variable whose scope is the scoping unit that contains the statement."
I believe this has been fixed in gfortran 4.8.1
I believe this has been fixed in GCC 4.8 by the patch for PR54958. Close as FIXED.