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:
parent
9d48ad93c6
commit
09e7f68631
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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.
|
||||
|
10
gcc/testsuite/gfortran.dg/func_result_2.f90
Normal file
10
gcc/testsuite/gfortran.dg/func_result_2.f90
Normal 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
|
Loading…
Reference in New Issue
Block a user