* resolve.c (resolve_symbol): Copy 'pointer' and 'dimension'
attribute from result symbol to function symbol.
testsuite/
* gfortran.dg/func_result_2.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99580
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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;
}
}
}
if (!se->direct_byref)
{
- if (sym->result->attr.dimension)
+ if (sym->attr.dimension)
{
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>
* gfortran.dg/dev_null.f90: New test.
--- /dev/null
+! { 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