Is the following code standard-conforming?
elemental function elemf( n, s ) result( new_s )
integer, intent(in) :: n
character(len=*), intent(in) :: s
! Function result
character(len=n*len(s)) :: new_s
new_s = repeat( s, ncopies=n )
end function
keeping in mind the Corrigenda (document N2122 at
https://wg5-fortran.org/f2008.html) to Fortran 2008 that includes
-------------
Subclause 12.8.1
In constraint C1290, after “The result” delete “variable”.
[314:4-5] f08/0049 TC1
In constraint C1290, delete “, and shall not ... constant expression”.
[314:5+] f08/0024 and f08/0049 TC1
Following constraint C1290 insert two new constraints:
C1290a The specification-part of an elemental subprogram shall specify
the intents of all of
its dummy arguments that do not have the VALUE attribute.
C1290b In the specification-expr that specifies a type parameter value
of the result of an
elemental function, an object designator with a dummy argument of the
function as
the base object shall appear only as the subject of a specification
inquiry, and that
specification inquiry shall not depend on a property that is deferred.
-------------
Thanks much,
Vipul Parekh
|