From 3cb8bd451b4c2922d030109030c72a1b44de0c36 Mon Sep 17 00:00:00 2001 From: pault Date: Tue, 28 Feb 2017 19:32:02 +0000 Subject: [PATCH] 2017-02-28 Paul Thomas PR fortran/79739 * resolve.c (resolve_fl_procedure): Deal with the case where 'submodule_name' is NULL so that gfc_error does not ICE. Reformat the error message to make it more consistent. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245787 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/resolve.c | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e9432d2cd91..3e4fde16764 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2017-02-28 Paul Thomas + + PR fortran/79739 + * resolve.c (resolve_fl_procedure): Deal with the case where + 'submodule_name' is NULL so that gfc_error does not ICE. + Reformat the error message to make it more consistent. + 2017-02-28 Jakub Jelinek * parse.c (parse_critical_block): Use cond ? G_("...") : G_("...") diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 876f3cd5d8c..37ffde820e0 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -12341,9 +12341,10 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag) if (!gfc_check_result_characteristics (sym, iface, errmsg, 200)) { gfc_error ("%s between the MODULE PROCEDURE declaration " - "in module %s and the declaration at %L in " - "SUBMODULE %s", errmsg, module_name, - &sym->declared_at, submodule_name); + "in MODULE '%s' and the declaration at %L in " + "(SUB)MODULE '%s'", + errmsg, module_name, &sym->declared_at, + submodule_name ? submodule_name : module_name); return false; } -- 2.11.4.GIT