re PR fortran/34901 (add kind information to mismatched-types error message)
authorTobias Burnus <burnus@net-b.de>
Mon, 21 Jan 2008 18:33:10 +0000 (19:33 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Mon, 21 Jan 2008 18:33:10 +0000 (19:33 +0100)
2007-01-21  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34901
        * interface.c (compare_parameter): Improved error message
        for arguments of same type and mismatched kinds.

From-SVN: r131700

gcc/fortran/ChangeLog
gcc/fortran/interface.c

index 86b028231b9a598eb39025e7f1aeed2c22bb7f26..6446e95638f5f6b926ce955aeebf61f834f52611 100644 (file)
@@ -1,3 +1,9 @@
+2007-01-21  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/34901
+       * interface.c (compare_parameter): Improved error message
+       for arguments of same type and mismatched kinds.
+
 2008-01-20  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/34861
index 8b1f5db21dc9acad6fccdd314c1add9bdf6b0aef..ef639845c7891670812b4d4ca8fd0de216a3d6fc 100644 (file)
@@ -1470,18 +1470,10 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
   if ((actual->expr_type != EXPR_NULL || actual->ts.type != BT_UNKNOWN)
       && !gfc_compare_types (&formal->ts, &actual->ts))
     {
-      if (where && actual->ts.type == BT_DERIVED
-         && formal->ts.type == BT_DERIVED)
-       gfc_error ("Type mismatch in argument '%s' at %L; passed type(%s) to "
-                  "type(%s)", formal->name, &actual->where,
-                  actual->ts.derived->name, formal->ts.derived->name);
-      else if (where)
+      if (where)
        gfc_error ("Type mismatch in argument '%s' at %L; passed %s to %s",
-                  formal->name, &actual->where,
-                  actual->ts.type == BT_DERIVED ? "derived type"
-                                    : gfc_basic_typename (actual->ts.type),
-                  formal->ts.type == BT_DERIVED ? "derived type"
-                                    : gfc_basic_typename (formal->ts.type));
+                  formal->name, &actual->where, gfc_typename (&actual->ts),
+                  gfc_typename (&formal->ts));
       return 0;
     }