Commit ac193ee7 by Louis Krupp Committed by Louis Krupp

2016_10-06 Louis Krupp <louis.krupp@zoho.com>

	PR fortran/57910
	* gfortran.dg/pr57910.f90: New test.

2016-10-05  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/57910
	* trans-expr.c (gfc_add_interface_mapping): Don't try to
	dereference call-by-value scalar argument

From-SVN: r240850
parent fe37b0f0
2016-10-05 Louis Krupp <louis.krupp@zoho.com>
PR fortran/57910
* trans-expr.c (gfc_add_interface_mapping): Don't try to
dereference call-by-value scalar argument
2016-10-05 Steven G. Kargl <kargls@gcc.gnu.org>
PR fortran/58991
......
......@@ -4009,6 +4009,10 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping,
if (sym->attr.flavor == FL_PROCEDURE)
value = se->expr;
/* If the argument is a pass-by-value scalar, use the value as is. */
else if (!sym->attr.dimension && sym->attr.value)
value = se->expr;
/* If the argument is either a string or a pointer to a string,
convert it to a boundless character type. */
else if (!sym->attr.dimension && sym->ts.type == BT_CHARACTER)
......
2016_10-06 Louis Krupp <louis.krupp@zoho.com>
PR fortran/57910
* gfortran.dg/pr57910.f90: New test.
2016-10-06 Jakub Jelinek <jakub@redhat.com>
* g++.dg/cpp1z/has-unique-obj-representations1.C: New test.
......
! { dg-do run }
program strtest
implicit none
character(len=:), allocatable:: my_str
integer, parameter :: slen_init = 7
integer :: slen = slen_init
my_str = fstr(slen)
if (slen /= slen_init .or. len(my_str) /= slen .or. my_str /= ' ') then
call abort
endif
contains
function fstr(strlen)
integer, value :: strlen
character(len=strlen)::fstr
strlen = 17 ! Make sure strlen was really passed by value
fstr = ' '
end function fstr
end program strtest
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