re PR fortran/53542 (Diagnostic of USE-associated variables shows original instead...
authorDominique d'Humieres <dominiq@lps.ens.fr>
Tue, 1 Aug 2017 09:02:58 +0000 (11:02 +0200)
committerDominique d'Humieres <dominiq@gcc.gnu.org>
Tue, 1 Aug 2017 09:02:58 +0000 (11:02 +0200)
2017-08-01  Dominique d'Humieres  <dominiq@lps.ens.fr>

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
gcc/fortran/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/use_30.f90 [new file with mode: 0644]

index dc0495af964672dd59e5519ab524e51305f34eea..799ae4f6a837b28a70b69350e311fb8412fd56a7 100644 (file)
@@ -1,3 +1,8 @@
+2017-08-01  Dominique d'Humieres  <dominiq@lps.ens.fr>
+
+       PR fortran/53542
+       * expr.c (gfc_check_init_expr): Use the renamed name.
+
 2017-07-31  Jakub Jelinek  <jakub@redhat.com>
 
        * check.c (gfc_check_num_images): Fix a pasto.
index d19e2fdde44c0b1f65f2ec0108e74bc4bb5c0e1a..64af02cc29b9e1b630468a7d4e12cf2b8a0c350b 100644 (file)
@@ -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;
 
index 5d05b3b695bec63b062e58e906e616cce51a59f3..08d649c8ed60b852cc677f696f603fc3f2fd922d 100644 (file)
@@ -1,3 +1,8 @@
+2017-08-01  Dominique d'Humieres  <dominiq@lps.ens.fr>
+
+       PR testsuite/53542
+       * gfortran.dg/use_30.f90: New test.
+
 2017-08-01  Jakub Jelinek  <jakub@redhat.com>
 
        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 (file)
index 0000000..b0f2ad4
--- /dev/null
@@ -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