diff options
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/typebound_assignment_4.f90 | 35 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/typebound_operator_19.f90 | 29 |
5 files changed, 77 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index bde2d1c6f3b..50d7538f9c3 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 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 PR fortran/54195 * gfortran.h (struct gfc_symbol): New field 'resolved'. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 5083a5d04dd..1bb18c97a8b 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8f407555dcb..156fa38358c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,11 @@ 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 * gfortran.dg/recursive_interface_1.f90: New test. diff --git a/gcc/testsuite/gfortran.dg/typebound_assignment_4.f90 b/gcc/testsuite/gfortran.dg/typebound_assignment_4.f90 new file mode 100644 index 00000000000..56f3b6eb0b0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_assignment_4.f90 @@ -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 diff --git a/gcc/testsuite/gfortran.dg/typebound_operator_19.f90 b/gcc/testsuite/gfortran.dg/typebound_operator_19.f90 new file mode 100644 index 00000000000..cf09379afff --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_operator_19.f90 @@ -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 |