diff options
author | Janus Weil <janus@gcc.gnu.org> | 2016-11-25 18:22:37 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2016-11-25 18:22:37 +0100 |
commit | f76c4d97aee6c1845baf764ae6b97a530f32858d (patch) | |
tree | 7847ca9dd8a61c308edda40281727f7bb36cc8cd /gcc | |
parent | 27d0862e62b5af5cce218a32cfcf3db27c85d1f2 (diff) | |
download | gcc-f76c4d97aee6c1845baf764ae6b97a530f32858d.zip gcc-f76c4d97aee6c1845baf764ae6b97a530f32858d.tar.gz gcc-f76c4d97aee6c1845baf764ae6b97a530f32858d.tar.bz2 |
re PR fortran/60853 ([OOP] Failure to disambiguate generic with unlimited polymorphic)
2016-11-25 Janus Weil <janus@gcc.gnu.org>
PR fortran/60853
* interface.c (gfc_compare_interfaces): Remove bad special case for
unlimited polymorphism. Refactor for loop.
2016-11-25 Janus Weil <janus@gcc.gnu.org>
PR fortran/60853
* gfortran.dg/typebound_assignment_8.f90: New test case.
From-SVN: r242880
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/interface.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/typebound_assignment_8.f90 | 29 |
4 files changed, 41 insertions, 9 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 737a22c..b208f5c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2016-11-25 Janus Weil <janus@gcc.gnu.org> + + PR fortran/60853 + * interface.c (gfc_compare_interfaces): Remove bad special case for + unlimited polymorphism. Refactor for loop. + 2016-11-25 Andre Vehreschild <vehre@gcc.gnu.org> Paul Thomas <pault@gcc.gnu.org> diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 4c8d671..f5d3f77 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1728,11 +1728,9 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2, This is also done when comparing interfaces for dummy procedures and in procedure pointer assignments. */ - for (;;) + for (; f1 || f2; f1 = f1->next, f2 = f2->next) { /* Check existence. */ - if (f1 == NULL && f2 == NULL) - break; if (f1 == NULL || f2 == NULL) { if (errmsg != NULL) @@ -1741,9 +1739,6 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2, return 0; } - if (UNLIMITED_POLY (f1->sym)) - goto next; - if (strict_flag) { /* Check all characteristics. */ @@ -1772,9 +1767,6 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2, return 0; } } -next: - f1 = f1->next; - f2 = f2->next; } return 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a4f67e5..e741b74 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-11-25 Janus Weil <janus@gcc.gnu.org> + + PR fortran/60853 + * gfortran.dg/typebound_assignment_8.f90: New test case. + 2016-11-25 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/78527 diff --git a/gcc/testsuite/gfortran.dg/typebound_assignment_8.f90 b/gcc/testsuite/gfortran.dg/typebound_assignment_8.f90 new file mode 100644 index 0000000..1572777 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/typebound_assignment_8.f90 @@ -0,0 +1,29 @@ +! { dg-do compile } +! +! PR 60853: [OOP] Failure to disambiguate generic with unlimited polymorphic +! +! Contributed by tlcclt <Thomas.L.Clune@nasa.gov> + +module foo_mod + implicit none + + type Vector + contains + procedure :: copyFromScalar + procedure :: copyFromArray + generic :: assignment(=) => copyFromScalar, copyFromArray + end type + +contains + + subroutine copyFromScalar(this, scalar) + class (Vector), intent(inout) :: this + type (Vector), intent(in) :: scalar + end subroutine + + subroutine copyFromArray(this, array) + class (Vector), intent(inout) :: this + class (*), intent(in) :: array(:) + end subroutine + +end module |