mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-19 11:00:48 +08:00
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:
parent
e731262b38
commit
b185792f52
@ -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.
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
25
gcc/testsuite/gfortran.dg/typebound_operator_18.f90
Normal file
25
gcc/testsuite/gfortran.dg/typebound_operator_18.f90
Normal 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" } }
|
Loading…
x
Reference in New Issue
Block a user