From 8e119f1b63d9de421ffdda86e8a710ba30b58d34 Mon Sep 17 00:00:00 2001 From: Erik Edelmann Date: Fri, 10 Mar 2006 23:28:38 +0000 Subject: symbol.c (check_conflict): Allow allocatable function results, except for elemental functions. fortran/ 2006-03-11 Erik Edelmann * symbol.c (check_conflict): Allow allocatable function results, except for elemental functions. * trans-array.c (gfc_trans_allocate_temp_array): Rename to ... (gfc_trans_create_temp_array): ... this, and add new argument callee_alloc. (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to gfc_trans_allocate_temp_array. * trans-array.h (gfc_trans_allocate_temp_array): Update prototype. * trans-expr.c (gfc_conv_function_call): Use new arg of gfc_trans_create_temp_array avoid pre-allocation of temporary result variables of pointer AND allocatable functions. (gfc_trans_arrayfunc_assign): Return NULL for allocatable functions. * resolve.c (resolve_symbol): Copy value of 'allocatable' attribute from sym->result to sym. testsuite/ 2006-03-08 Paul Thomas Erik Edelmann * gfortran.dg/allocatable_function_1.f90: New. * gfortran.dg/allocatable_function_2.f90: New. From-SVN: r111951 --- gcc/fortran/symbol.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/fortran/symbol.c') diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index e98556d..bd7ad1c 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -322,6 +322,7 @@ check_conflict (symbol_attribute * attr, const char * name, locus * where) conf (pointer, external); conf (pointer, intrinsic); conf (pointer, elemental); + conf (allocatable, elemental); conf (target, external); conf (target, intrinsic); @@ -337,8 +338,8 @@ check_conflict (symbol_attribute * attr, const char * name, locus * where) conf (allocatable, pointer); conf_std (allocatable, dummy, GFC_STD_F2003); - conf (allocatable, function); /* TODO: Allowed in Fortran 200x. */ - conf (allocatable, result); /* TODO: Allowed in Fortran 200x. */ + conf_std (allocatable, function, GFC_STD_F2003); + conf_std (allocatable, result, GFC_STD_F2003); conf (elemental, recursive); conf (in_common, dummy); -- cgit v1.1