http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50517
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011-09-26
AssignedTo|unassigned at gcc dot |janus at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
--- Comment #5 from janus at gcc dot gnu.org 2011-09-26 09:12:04 UTC ---
With the following patch, both comment #0 and comment #2 are correctly
rejected:
Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c (revision 179143)
+++ gcc/fortran/interface.c (working copy)
@@ -1124,10 +1124,10 @@ gfc_compare_interfaces (gfc_symbol *s1, gfc_symbol
/* If both are functions, check type and kind. */
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;
}