Commit 09e7f686 by Tobias Schlüter Committed by Tobias Schlüter

resolve.c (resolve_symbol): Copy 'pointer' and 'dimension' attribute from result…

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
parent 9d48ad93
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> 2005-05-10 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/20178 PR fortran/20178
......
...@@ -4061,6 +4061,8 @@ resolve_symbol (gfc_symbol * sym) ...@@ -4061,6 +4061,8 @@ resolve_symbol (gfc_symbol * sym)
sym->ts = sym->result->ts; sym->ts = sym->result->ts;
sym->as = gfc_copy_array_spec (sym->result->as); sym->as = gfc_copy_array_spec (sym->result->as);
sym->attr.dimension = sym->result->attr.dimension;
sym->attr.pointer = sym->result->attr.pointer;
} }
} }
} }
......
...@@ -1288,7 +1288,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, ...@@ -1288,7 +1288,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
if (!se->direct_byref) if (!se->direct_byref)
{ {
if (sym->result->attr.dimension) if (sym->attr.dimension)
{ {
if (flag_bounds_check) if (flag_bounds_check)
{ {
......
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> 2005-05-11 Bud Davis <bdavis@gfortran.org>
* gfortran.dg/dev_null.f90: New test. * gfortran.dg/dev_null.f90: New test.
......
! { 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment