Commit a920e94a by Paul Thomas

re PR fortran/18578 (intent(inout) violation is not detected)

2006-01-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/18578
	PR fortran/18579
	PR fortran/20857
	PR fortran/20885
	* interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
	if actual argument is not a variable.

2006-01-29  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/18578
	PR fortran/18579
	PR fortran/20857
	PR fortran/20885
	* gfortran.dg/intent_out_1.f90: New test.

From-SVN: r110376
parent e8f9ec35
2006-01-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/18578
PR fortran/18579
PR fortran/20857
PR fortran/20885
* interface.c (compare_actual_formal): Error for INTENT(OUT or INOUT)
if actual argument is not a variable.
2006-01-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/17911
......
......@@ -1273,6 +1273,16 @@ compare_actual_formal (gfc_actual_arglist ** ap,
return 0;
}
/* Check intent = OUT/INOUT for definable actual argument. */
if (a->expr->expr_type != EXPR_VARIABLE
&& (f->sym->attr.intent == INTENT_OUT
|| f->sym->attr.intent == INTENT_INOUT))
{
gfc_error ("Actual argument at %L must be definable to "
"match dummy INTENT = OUT/INOUT", &a->expr->where);
return 0;
}
match:
if (a == actual)
na = i;
......
2006-01-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/18578
PR fortran/18579
PR fortran/20857
PR fortran/20885
* gfortran.dg/intent_out_1.f90: New test.
2006-01-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/17911
* gfortran.dg/procedure_lvalue.f90: New test.
! { dg-do compile }
! Tests the fix for PRs 18578, 18579 and their repeats 20857 and 20885.
! Contributed by Paul Thomas <pault@gcc@gnu.org>
real, parameter :: a =42.0
real :: b
call foo(b + 2.0) ! { dg-error "must be definable" }
call foo(a) ! { dg-error "must be definable" }
call bar(b + 2.0) ! { dg-error "must be definable" }
call bar(a) ! { dg-error "must be definable" }
contains
subroutine foo(a)
real, intent(out) :: a
a = 0.0
end subroutine foo
subroutine bar(a)
real, intent(INout) :: a
a = 0.0
end subroutine bar
end
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