diff options
Diffstat (limited to 'gcc/fortran/resolve.c')
| -rw-r--r-- | gcc/fortran/resolve.c | 14 |
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))) { |
