Commit 1f46d137 by Janus Weil

re PR fortran/58099 ([F03] over-zealous procedure-pointer error checking)

2013-09-20  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58099
	* expr.c (gfc_check_pointer_assign): Remove second call to
	'gfc_compare_interfaces' with swapped arguments.
	* interface.c (gfc_compare_interfaces): Symmetrize the call to
	'check_result_characteristics' by calling it with swapped arguments.

2013-09-20  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58099
	* gfortran.dg/proc_ptr_43.f90: New.

From-SVN: r202766
parent 87fccdbb
2013-09-20 Janus Weil <janus@gcc.gnu.org>
PR fortran/58099
* expr.c (gfc_check_pointer_assign): Remove second call to
'gfc_compare_interfaces' with swapped arguments.
* interface.c (gfc_compare_interfaces): Symmetrize the call to
'check_result_characteristics' by calling it with swapped arguments.
2013-09-18 Tobias Burnus <burnus@net-b.de> 2013-09-18 Tobias Burnus <burnus@net-b.de>
* expr.c (gfc_check_assign_symbol): Free lvalue.ref. * expr.c (gfc_check_assign_symbol): Free lvalue.ref.
......
...@@ -3581,14 +3581,6 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) ...@@ -3581,14 +3581,6 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
return false; return false;
} }
if (!gfc_compare_interfaces (s2, s1, name, 0, 1,
err, sizeof(err), NULL, NULL))
{
gfc_error ("Interface mismatch in procedure pointer assignment "
"at %L: %s", &rvalue->where, err);
return false;
}
return true; return true;
} }
......
...@@ -1416,7 +1416,8 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2, ...@@ -1416,7 +1416,8 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2,
if (s1->attr.function && s2->attr.function) if (s1->attr.function && s2->attr.function)
{ {
/* If both are functions, check result characteristics. */ /* If both are functions, check result characteristics. */
if (!check_result_characteristics (s1, s2, errmsg, err_len)) if (!check_result_characteristics (s1, s2, errmsg, err_len)
|| !check_result_characteristics (s2, s1, errmsg, err_len))
return 0; return 0;
} }
......
2013-09-20 Janus Weil <janus@gcc.gnu.org>
PR fortran/58099
* gfortran.dg/proc_ptr_43.f90: New.
2013-09-18 Tobias Burnus <burnus@net-b.de> 2013-09-18 Tobias Burnus <burnus@net-b.de>
PR fortran/57697 PR fortran/57697
......
! { dg-do compile }
!
! PR 58099: [4.8/4.9 Regression] [F03] over-zealous procedure-pointer error checking
!
! Contributed by Daniel Price <daniel.price@monash.edu>
implicit none
procedure(real), pointer :: wfunc
wfunc => w_cubic
contains
pure real function w_cubic(q2)
real, intent(in) :: q2
w_cubic = 0.
end function
end
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