aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2019-08-17 17:15:42 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2019-08-17 17:15:42 +0000
commitb9a21efdea18862f79c68ceb2eee0704844ead53 (patch)
treea444631882998d3b411bc5adb6625e7f311ec123 /gcc/fortran/module.c
parent716ac0fc6c0ef0f1bf3a295f1338eeb697cddb43 (diff)
downloadgcc-b9a21efdea18862f79c68ceb2eee0704844ead53.zip
gcc-b9a21efdea18862f79c68ceb2eee0704844ead53.tar.gz
gcc-b9a21efdea18862f79c68ceb2eee0704844ead53.tar.bz2
re PR fortran/82992 (ICE in create_int_parameter_array, at fortran/module.c:6586)
2019-08-17 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/82992 * module.c (gfc_match_use): When renaming a module entity, search current namespace for conflicting symbol. 2019-08-17 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/82992 * gfortran.dg/pr71649.f90: Adjust error messages. * gfortran.dg/use_15.f90: Ditto. * gfortran.dg/use_rename_8.f90: Ditto. From-SVN: r274608
Diffstat (limited to 'gcc/fortran/module.c')
-rw-r--r--gcc/fortran/module.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 9c8ae13..fb6173d 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -525,6 +525,8 @@ gfc_match_use (void)
gfc_intrinsic_op op;
match m;
gfc_use_list *use_list;
+ gfc_symtree *st;
+ locus loc;
use_list = gfc_get_use_list ();
@@ -632,6 +634,8 @@ gfc_match_use (void)
case INTERFACE_USER_OP:
case INTERFACE_GENERIC:
case INTERFACE_DTIO:
+ loc = gfc_current_locus;
+
m = gfc_match (" =>");
if (type == INTERFACE_USER_OP && m == MATCH_YES
@@ -642,6 +646,18 @@ gfc_match_use (void)
if (type == INTERFACE_USER_OP)
new_use->op = INTRINSIC_USER;
+ st = gfc_find_symtree (gfc_current_ns->sym_root, name);
+ if (st)
+ {
+ if (m == MATCH_YES)
+ gfc_error ("Symbol %qs at %L conflicts with the rename symbol "
+ "at %L", name, &st->n.sym->declared_at, &loc);
+ else
+ gfc_error ("Symbol %qs at %L conflicts with the symbol "
+ "at %L", name, &st->n.sym->declared_at, &loc);
+ goto cleanup;
+ }
+
if (use_list->only_flag)
{
if (m != MATCH_YES)