re PR fortran/54195 ([OOP] IMPORT fails with GENERIC TBP: "is already present in the interface")

fortran/
	PR fortran/54195
	* resolve.c (resolve_typebound_procedures): Recurse through
	resolve_symbol.

testsuite/
	PR fortran/54195
	* gfortran.dg/typebound_operator_19.f90: New test.
	* gfortran.dg/typebound_assignment_4.f90: New test.

From-SVN: r195730
This commit is contained in:
Mikael Morin 2013-02-04 19:06:06 +00:00
parent 4af8d042f8
commit 49c8d79b27
5 changed files with 77 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-02-04 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/54195
* resolve.c (resolve_typebound_procedures): Recurse through
resolve_symbol.
2013-02-04 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/54107

View File

@ -12344,7 +12344,7 @@ resolve_typebound_procedures (gfc_symbol* derived)
super_type = gfc_get_derived_super_type (derived);
if (super_type)
resolve_typebound_procedures (super_type);
resolve_symbol (super_type);
resolve_bindings_derived = derived;
resolve_bindings_result = SUCCESS;

View File

@ -1,3 +1,9 @@
2013-02-04 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/54195
* gfortran.dg/typebound_operator_19.f90: New test.
* gfortran.dg/typebound_assignment_4.f90: New test.
2013-02-04 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/54107

View File

@ -0,0 +1,35 @@
! { dg-do compile }
!
! PR fortran/54195
! The compiler used to diagnose a duplicate entity in the assignment interface
! because NC was resolved twice.
!
! Contributed by Andrew Benson <abenson@obs.carnegiescience.edu>
module gn
implicit none
type :: nc
contains
procedure :: assign => nca
generic :: assignment(=) => assign
end type
type, extends(nc) :: ncb
contains
procedure , nopass :: tis => bf
end type
contains
subroutine nca(to,from)
class(nc), intent(out) :: to
type(nc), intent(in) :: from
end subroutine
logical function bf()
bf=.false.
end function
end module

View File

@ -0,0 +1,29 @@
! { dg-do compile }
!
! PR fortran/54195
! The compiler used to diagnose a duplicate entity in the assignment interface
! because NC was resolved twice.
!
! Contributed by Damian Rouson <damian@rouson.net>
module import_clashes_with_generic
type ,abstract :: foo
contains
procedure :: unary
generic :: operator(-) => unary
end type
abstract interface
integer function bar()
import :: foo
end function
end interface
contains
integer function unary(rhs)
class(foo) ,intent(in) :: rhs
end function
end module