https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38351
--- Comment #2 from kargl at gcc dot gnu.org --- Index: resolve.c =================================================================== --- resolve.c (revision 236243) +++ resolve.c (working copy) @@ -3586,7 +3586,13 @@ resolve_operator (gfc_expr *e) break; } - sprintf (msg, + if (op1->ts.type == BT_DERIVED || op2->ts.type == BT_DERIVED) + sprintf (msg, + _("Incompatible data types for operands of defined " + "binary operator %%<%s%%> at %%L"), + gfc_op2string (e->value.op.op)); + else + sprintf (msg, _("Operands of binary numeric operator %%<%s%%> at %%L are %s/%s"), gfc_op2string (e->value.op.op), gfc_typename (&op1->ts), gfc_typename (&op2->ts));