diff options
author | Tobias Burnus <burnus@net-b.de> | 2008-01-21 19:33:10 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2008-01-21 19:33:10 +0100 |
commit | d68e117b15c0313115ee8649387927c876756fab (patch) | |
tree | 4c9b1deb5aa24b11984be9fd982a4a7a7d8401cb /gcc/fortran/interface.c | |
parent | bb0c55f6ee50d62e355558db86ebeb7d6ec04d70 (diff) | |
download | gcc-d68e117b15c0313115ee8649387927c876756fab.zip gcc-d68e117b15c0313115ee8649387927c876756fab.tar.gz gcc-d68e117b15c0313115ee8649387927c876756fab.tar.bz2 |
re PR fortran/34901 (add kind information to mismatched-types error message)
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
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 8b1f5db..ef63984 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -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; } |