re PR fortran/55297 ([OOP] type-bound operator clashes with abstract interface)

2012-11-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/55297
	* resolve.c (resolve_typebound_intrinsic_op): Only add typebound
	operators to the operator list in the namespace of the derived type.

2012-11-16  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/55297
	* gfortran.dg/typebound_operator_18.f90: New.

From-SVN: r193568
This commit is contained in:
Janus Weil 2012-11-16 18:02:02 +01:00
parent e731262b38
commit b185792f52
4 changed files with 37 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2012-11-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/55297
* resolve.c (resolve_typebound_intrinsic_op): Only add typebound
operators to the operator list in the namespace of the derived type.
2012-11-12 Jan Hubicka <jh@suse.cz>
* f95-lang.c (ATTR_NOTHROW_LEAF_MALLOC_LIST): New macro.

View File

@ -11540,7 +11540,7 @@ resolve_typebound_intrinsic_op (gfc_symbol* derived, gfc_intrinsic_op op,
/* Add target to non-typebound operator list. */
if (!target->specific->deferred && !derived->attr.use_assoc
&& p->access != ACCESS_PRIVATE)
&& p->access != ACCESS_PRIVATE && derived->ns == gfc_current_ns)
{
gfc_interface *head, *intr;
if (gfc_check_new_interface (derived->ns->op[op], target_proc,

View File

@ -1,3 +1,8 @@
2012-11-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/55297
* gfortran.dg/typebound_operator_18.f90: New.
2012-11-16 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/55330

View File

@ -0,0 +1,25 @@
! { dg-do compile }
!
! PR 55297: [4.8 Regression] [OOP] type-bound operator clashes with abstract interface
!
! Contributed by Damian Rouson <damian@rouson.net>
module athlete_module
type athlete
contains
procedure :: negative
generic :: operator(-) => negative
end type
abstract interface
integer function sum_interface(this)
import athlete
class(athlete) this
end function
end interface
contains
integer function negative(this)
class(athlete) ,intent(in) :: this
end function
end module
! { dg-final { cleanup-modules "athlete_module" } }