diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2006-01-29 16:31:24 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2006-01-29 16:31:24 +0000 |
commit | a920e94a9e87d680206d24e1a38902f3c5536c29 (patch) | |
tree | 2efa745c0302c8ea212bcdc685d98c5d62accfe1 /gcc/fortran/interface.c | |
parent | e8f9ec3507675aa1687cb38f7b307b301c6e3f1a (diff) | |
download | gcc-a920e94a9e87d680206d24e1a38902f3c5536c29.zip gcc-a920e94a9e87d680206d24e1a38902f3c5536c29.tar.gz gcc-a920e94a9e87d680206d24e1a38902f3c5536c29.tar.bz2 |
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
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index e3a13f5..93e3657 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -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; |