diff options
author | Janus Weil <janus@gcc.gnu.org> | 2010-10-30 15:52:39 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2010-10-30 15:52:39 +0200 |
commit | 2b603773b47c8ace0651184e754c421021e2728d (patch) | |
tree | fd6a0c69cca694f861b7ee5ae4ffebbd0f3564fb /gcc/fortran/interface.c | |
parent | 3127848955bbdaa2fca1b4984b3d78b42d1a36e1 (diff) | |
download | gcc-2b603773b47c8ace0651184e754c421021e2728d.zip gcc-2b603773b47c8ace0651184e754c421021e2728d.tar.gz gcc-2b603773b47c8ace0651184e754c421021e2728d.tar.bz2 |
re PR fortran/44917 ([OOP] Detect ambiguous specifics in a generic TBP interface)
2010-10-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/44917
PR fortran/44926
PR fortran/46196
* interface.c (count_types_test): Symmetrize type check.
(generic_correspondence): Ditto.
2010-10-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/44917
PR fortran/44926
PR fortran/46196
* gfortran.dg/typebound_generic_10.f03: New.
From-SVN: r166089
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 16b941c..cf83557 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -872,7 +872,8 @@ count_types_test (gfc_formal_arglist *f1, gfc_formal_arglist *f2) /* Find other nonoptional arguments of the same type/rank. */ for (j = i + 1; j < n1; j++) if ((arg[j].sym == NULL || !arg[j].sym->attr.optional) - && compare_type_rank_if (arg[i].sym, arg[j].sym)) + && (compare_type_rank_if (arg[i].sym, arg[j].sym) + || compare_type_rank_if (arg[j].sym, arg[i].sym))) arg[j].flag = k; k++; @@ -897,7 +898,8 @@ count_types_test (gfc_formal_arglist *f1, gfc_formal_arglist *f2) ac2 = 0; for (f = f2; f; f = f->next) - if (compare_type_rank_if (arg[i].sym, f->sym)) + if (compare_type_rank_if (arg[i].sym, f->sym) + || compare_type_rank_if (f->sym, arg[i].sym)) ac2++; if (ac1 > ac2) @@ -948,7 +950,8 @@ generic_correspondence (gfc_formal_arglist *f1, gfc_formal_arglist *f2) if (f1->sym->attr.optional) goto next; - if (f2 != NULL && compare_type_rank (f1->sym, f2->sym)) + if (f2 != NULL && (compare_type_rank (f1->sym, f2->sym) + || compare_type_rank (f2->sym, f1->sym))) goto next; /* Now search for a disambiguating keyword argument starting at |