public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Dominique d'Humières" <dominiq@lps.ens.fr>
To: burnus@gcc.gnu.org
Cc: gfortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH gfortran] PR53542 USE-associated variables shows original instead of renamed symbol name
Date: Thu, 27 Jul 2017 08:31:00 -0000	[thread overview]
Message-ID: <2677032B-DFC0-43F1-9AB8-308AF7A2EEBF@lps.ens.fr> (raw)

Dear all,

I am planning to commit the following patch as obvious (once Tobias has done the debugging) unless someone objects in the coming days.

Cheers,

Dominique

2017-07-27  Dominique d'Humieres  <dominiq@lps.ens.fr>

        PR fortran/53542
        * expr.c (gfc_check_init_expr): Use the renamed name.

2017-07-27  Dominique d'Humieres  <dominiq@lps.ens.fr>

        PR testsuite/53542
        * gfortran.dg/use_30.f90: New test.

--- ../_clean/gcc/fortran/expr.c	2017-06-04 21:41:26.000000000 +0200
+++ gcc/fortran/expr.c	2017-06-25 13:07:33.000000000 +0200
@@ -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;
 
--- ../_clean/gcc/testsuite/gfortran.dg/use_30.f90	1970-01-01 01:00:00.000000000 +0100
+++ gcc/testsuite/gfortran.dg/use_30.f90	2017-04-03 15:49:13.000000000 +0200
@@ -0,0 +1,17 @@
+! { dg-do compile }
+!
+! PR53542 USE-associated variables shows original instead of renamed symbol name
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+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

             reply	other threads:[~2017-07-27  8:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27  8:31 Dominique d'Humières [this message]
2017-08-01  9:05 Dominique d'Humières

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2677032B-DFC0-43F1-9AB8-308AF7A2EEBF@lps.ens.fr \
    --to=dominiq@lps.ens.fr \
    --cc=burnus@gcc.gnu.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).