aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorErik Edelmann <eedelman@gcc.gnu.org>2006-03-05 19:24:48 +0000
committerErik Edelmann <eedelman@gcc.gnu.org>2006-03-05 19:24:48 +0000
commitaa08038dda94c80126a2ac54e8bab0964a95bf41 (patch)
treed1b0048a6e28bab0dfa55b141c9b8fb3793db643 /gcc/fortran/resolve.c
parent68c9b7d60a71b8ab9e0ebe692f74aedb61a95af1 (diff)
downloadgcc-aa08038dda94c80126a2ac54e8bab0964a95bf41.zip
gcc-aa08038dda94c80126a2ac54e8bab0964a95bf41.tar.gz
gcc-aa08038dda94c80126a2ac54e8bab0964a95bf41.tar.bz2
re PR fortran/16136 (Conflicting attributes ALLOCATABLE, DUMMY (F2003))
fortran/ 2005-03-05 Erik Edelmann <eedelman@gcc.gnu.org> PR fortran/16136 * symbol.c (conf_std): New macro. (check_conflict): Use it to allow ALLOCATABLE dummy arguments for F2003. * trans-expr.c (gfc_conv_function_call): Pass the address of the array descriptor when dummy argument is ALLOCATABLE. * interface.c (compare_allocatable): New function. (compare_actual_formal): Use it. resolve.c (resolve_deallocate_expr, resolve_allocate_expr): Check that INTENT(IN) variables aren't (de)allocated. * gfortran.texi (Fortran 2003 status): List ALLOCATABLE dummy arguments as supported. testsuite/ 2005-03-05 Erik Edelmann <eedelman@gcc.gnu.org> PR fortran/16136 * allocatable_dummy_1.f90: New. * allocatable_dummy_2.f90: New. From-SVN: r111741
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 63b2cd9..4bf394a 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -2914,6 +2914,13 @@ resolve_deallocate_expr (gfc_expr * e)
"ALLOCATABLE or a POINTER", &e->where);
}
+ if (e->symtree->n.sym->attr.intent == INTENT_IN)
+ {
+ gfc_error ("Can't deallocate INTENT(IN) variable '%s' at %L",
+ e->symtree->n.sym->name, &e->where);
+ return FAILURE;
+ }
+
return SUCCESS;
}
@@ -3015,6 +3022,13 @@ resolve_allocate_expr (gfc_expr * e, gfc_code * code)
return FAILURE;
}
+ if (e->symtree->n.sym->attr.intent == INTENT_IN)
+ {
+ gfc_error ("Can't allocate INTENT(IN) variable '%s' at %L",
+ e->symtree->n.sym->name, &e->where);
+ return FAILURE;
+ }
+
/* Add default initializer for those derived types that need them. */
if (e->ts.type == BT_DERIVED && (init_e = gfc_default_initializer (&e->ts)))
{