Commit a81a6d58 by Steven G. Kargl

re PR fortran/81849 (Size of automatic array argument specified by host-associated variable.)

2019-01-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/81849
	* resolve.c (resolve_symbol): Host associated varaibles can appear
	in the specification statement of a RESULT array.

2019-01-15  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/81849
	* gfortran.dg/pr81849.f90: New test.

From-SVN: r267948
parent 92f3a180
2019-01-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/81849
* resolve.c (resolve_symbol): Host associated varaibles can appear
in the specification statement of a RESULT array.
2019-01-15 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Deal with exprs
......
......@@ -15345,7 +15345,7 @@ resolve_symbol (gfc_symbol *sym)
/* Set the formal_arg_flag so that check_conflict will not throw
an error for host associated variables in the specification
expression for an array_valued function. */
if (sym->attr.function && sym->as)
if ((sym->attr.function || sym->attr.result) && sym->as)
formal_arg_flag = true;
saved_specification_expr = specification_expr;
......
2019-01-15 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/81849
* gfortran.dg/pr81849.f90: New test.
2019-01-15 Paul Thomas <pault@gcc.gnu.org>
* gfortran.dg/ISO_Fortran_binding_2.c : Change reference to
......
! { dg-do run }
! PR fortran/81849
program p
implicit none
integer :: n=3
if (any(g() /= f())) stop 1
contains
function g()
real g(n)
g = 7
end function g
function f() result(r)
real r(n)
r = 7
end function f
end program
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment