(j3.2006) Still illegal in F08?

Van Snyder Van.Snyder
Tue Jan 5 16:29:11 EST 2010


Let me expand on this to remove a red herring.

subroutine S ( X, A )
  real :: X(:)
  real, optional :: A(:)
  real :: B(merge(size(x),0,present(a))
end subroutine S

On Tue, 2010-01-05 at 13:26 -0800, Van Snyder wrote:
> The following declaration of B is not legal in F2003:
> 
>   subroutine S ( A )
>     real, optional :: A(:)
>     real :: B(merge(size(a),0,present(A))
>   end subroutine S
> 
> because "present" is not one of the specification inquiry functions
> listed starting at 04-007:125:37.
> 
> Even though we expanded the list of inquiry functions to include them
> all, it seems that this is still illegal in F2008 because A is optional
> and therefore not a restricted expression, and "present" doesn't return
> an integer result and therefore the "present(A)" argument of "merge"
> isn't a restricted expression.  Item (9)(b)(3) in 7.1.11p2 on page 150
> in 09-007r3 appears to be the killer.
> 
> Did we intend to allow or to prohibit this?
> 
> If we wanted to allow it, I think we would need to replace (9)(a) with
>   (a) a restricted expression,
>   (a') a reference to the PRESENT intrinsic function, or
> 
> Van
> 
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3




More information about the J3 mailing list