resolve.c (resolve_symbol): Copy 'pointer' and 'dimension' attribute from result symbol to function symbol.

fortran/
	* resolve.c (resolve_symbol): Copy 'pointer' and 'dimension'
	attribute from result symbol to function symbol.
testsuite/
	* gfortran.dg/func_result_2.f90: New test.

From-SVN: r99580
This commit is contained in:
Tobias Schlüter 2005-05-11 16:52:51 +02:00 committed by Tobias Schlüter
parent 9d48ad93c6
commit 09e7f68631
5 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-05-11 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* resolve.c (resolve_symbol): Copy 'pointer' and 'dimension'
attribute from result symbol to function symbol.
2005-05-10 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/20178

View File

@ -4061,6 +4061,8 @@ resolve_symbol (gfc_symbol * sym)
sym->ts = sym->result->ts;
sym->as = gfc_copy_array_spec (sym->result->as);
sym->attr.dimension = sym->result->attr.dimension;
sym->attr.pointer = sym->result->attr.pointer;
}
}
}

View File

@ -1288,7 +1288,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
if (!se->direct_byref)
{
if (sym->result->attr.dimension)
if (sym->attr.dimension)
{
if (flag_bounds_check)
{

View File

@ -1,3 +1,7 @@
2005-05-11 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* gfortran.dg/func_result_2.f90: New test.
2005-05-11 Bud Davis <bdavis@gfortran.org>
* gfortran.dg/dev_null.f90: New test.

View File

@ -0,0 +1,10 @@
! { dg-do run }
! Character functions with a result clause were broken
program testch
if (ch().ne."hello ") call abort()
contains
function ch result(str)
character(len = 10) :: str
str ="hello"
end function ch
end program testch