diff options
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index b8786440fbe..b3ddf5f08b3 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1990,8 +1990,9 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual, if (!gfc_expr_attr (actual).class_ok) return 0; - if (!gfc_compare_derived_types (CLASS_DATA (actual)->ts.u.derived, - CLASS_DATA (formal)->ts.u.derived)) + if ((!UNLIMITED_POLY (formal) || !UNLIMITED_POLY(actual)) + && !gfc_compare_derived_types (CLASS_DATA (actual)->ts.u.derived, + CLASS_DATA (formal)->ts.u.derived)) { if (where) gfc_error ("Actual argument to '%s' at %L must have the same " |