re PR fortran/45338 (Failure on interfacing a function passed as an argument as a custom operator)

2010-12-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/45338
	* resolve.c (resolve_operator):  Mark function for user-defined
	operator as referenced.

2010-12-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/45338
	* gfortran.dg/userdef_operator_2.f90:  New test case.

From-SVN: r168366
This commit is contained in:
Thomas Koenig 2010-12-31 11:20:22 +00:00
parent 1da41015bc
commit 7c1a49fa1b
4 changed files with 38 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2010-12-31 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45338
* resolve.c (resolve_operator): Mark function for user-defined
operator as referenced.
2010-12-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/46971

View File

@ -3793,9 +3793,12 @@ resolve_operator (gfc_expr *e)
sprintf (msg, _("Operand of user operator '%s' at %%L is %s"),
e->value.op.uop->name, gfc_typename (&op1->ts));
else
sprintf (msg, _("Operands of user operator '%s' at %%L are %s/%s"),
e->value.op.uop->name, gfc_typename (&op1->ts),
gfc_typename (&op2->ts));
{
sprintf (msg, _("Operands of user operator '%s' at %%L are %s/%s"),
e->value.op.uop->name, gfc_typename (&op1->ts),
gfc_typename (&op2->ts));
e->value.op.uop->op->sym->attr.referenced = 1;
}
goto bad_op;

View File

@ -1,3 +1,8 @@
2010-12-31 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/45338
* gfortran.dg/userdef_operator_2.f90: New test case.
2010-12-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/46971
@ -6,16 +11,16 @@
2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/method-conflict-3.m: New.
* objc.dg/method-conflict-4.m: New.
* obj-c++.dg/method-conflict-3.m: New.
* objc.dg/method-conflict-4.m: New.
* obj-c++.dg/method-conflict-3.m: New.
* obj-c++.dg/method-conflict-4.mm: New.
2010-12-30 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/class-extension-3.m: Updated.
* objc.dg/method-1.m: Updated.
* objc.dg/method-conflict-1.m: New.
* objc.dg/method-conflict-2.m: New.
* objc.dg/method-conflict-2.m: New.
* obj-c++.dg/class-extension-3.mm: Updated.
* obj-c++.dg/method-8.mm: Updated.
* obj-c++.dg/method-conflict-1.mm: New.

View File

@ -0,0 +1,17 @@
! { dg-do compile }
! PR 45338 - no ICE when cmp is not used explicitly.
! Test case by Simon Smart
module test_mod
implicit none
contains
subroutine test_fn (cmp)
interface operator(.myop.)
pure function cmp (a, b) result(ret)
integer, intent(in) :: a, b
logical ret
end function cmp
end interface
integer :: a, b
print*, a .myop. b
end subroutine test_fn
end module test_mod