From f9c5fe06f992ba29fccf7b3a15f5424b9ff254ce Mon Sep 17 00:00:00 2001 From: Dominique d'Humieres Date: Tue, 1 Aug 2017 11:02:58 +0200 Subject: [PATCH] re PR fortran/53542 (Diagnostic of USE-associated variables shows original instead of renamed symbol name) 2017-08-01 Dominique d'Humieres PR fortran/53542 * expr.c (gfc_check_init_expr): Use the renamed name. PR testsuite/53542 * gfortran.dg/use_30.f90: New test. From-SVN: r250762 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/expr.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/use_30.f90 | 17 +++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/use_30.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index dc0495af964..799ae4f6a83 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2017-08-01 Dominique d'Humieres + + PR fortran/53542 + * expr.c (gfc_check_init_expr): Use the renamed name. + 2017-07-31 Jakub Jelinek * check.c (gfc_check_num_images): Fix a pasto. diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index d19e2fdde44..64af02cc29b 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2591,7 +2591,7 @@ gfc_check_init_expr (gfc_expr *e) else gfc_error ("Parameter %qs at %L has not been declared or is " "a variable, which does not reduce to a constant " - "expression", e->symtree->n.sym->name, &e->where); + "expression", e->symtree->name, &e->where); break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5d05b3b695b..08d649c8ed6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-08-01 Dominique d'Humieres + + PR testsuite/53542 + * gfortran.dg/use_30.f90: New test. + 2017-08-01 Jakub Jelinek PR tree-optimization/81588 diff --git a/gcc/testsuite/gfortran.dg/use_30.f90 b/gcc/testsuite/gfortran.dg/use_30.f90 new file mode 100644 index 00000000000..b0f2ad470bb --- /dev/null +++ b/gcc/testsuite/gfortran.dg/use_30.f90 @@ -0,0 +1,17 @@ +! { dg-do compile } +! +! PR53542 USE-associated variables shows original instead of renamed symbol name +! Contributed by Tobias Burnus +! +module select_precision + integer :: dp = kind(1.0) +end module select_precision + +module ode_types + use select_precision, only: wp => dp +contains + subroutine ode_derivative(x) + real(wp) :: x ! { dg-error "Parameter .wp. at .1. has not been declared" } + end subroutine ode_derivative +end module ode_types +end -- 2.30.2