From ef71fdd925864fd461bd18cd52218495b457b29b Mon Sep 17 00:00:00 2001 From: Janus Weil Date: Mon, 26 Sep 2011 22:05:43 +0200 Subject: re PR fortran/50515 (gfortran should not accept an external that is a common (r178939)) 2011-09-26 Janus Weil PR fortran/50515 * resolve.c (resolve_common_blocks): Check for EXTERNAL attribute. PR fortran/50517 * interface.c (gfc_compare_interfaces): Bugfix in check for result type. 2011-09-26 Janus Weil PR fortran/50515 * gfortran.dg/common_15.f90: New. PR fortran/50517 * gfortran.dg/dummy_procedure_5.f90: New. * gfortran.dg/interface_26.f90: Modified error message. * gfortran.dg/proc_ptr_11.f90: Ditto. * gfortran.dg/proc_ptr_15.f90: Ditto. * gfortran.dg/proc_ptr_comp_20.f90: Ditto. * gfortran.dg/proc_ptr_result_5.f90: Ditto. From-SVN: r179213 --- gcc/fortran/interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/interface.c') diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 7cbe163..f65087b 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1121,13 +1121,13 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol *s2, const char *name2, { if (s1->attr.function && s2->attr.function) { - /* If both are functions, check type and kind. */ + /* If both are functions, check result type. */ if (s1->ts.type == BT_UNKNOWN) return 1; - if ((s1->ts.type != s2->ts.type) || (s1->ts.kind != s2->ts.kind)) + if (!compare_type_rank (s1,s2)) { if (errmsg != NULL) - snprintf (errmsg, err_len, "Type/kind mismatch in return value " + snprintf (errmsg, err_len, "Type/rank mismatch in return value " "of '%s'", name2); return 0; } -- cgit v1.1