re PR fortran/37400 (implicit character(len=*,kind=kind('A')) (Q) ... no longer gives...
authorTobias Burnus <burnus@gcc.gnu.org>
Mon, 8 Sep 2008 07:19:46 +0000 (09:19 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Mon, 8 Sep 2008 07:19:46 +0000 (09:19 +0200)
2008-09-07  Tobias Burnus  <burnus@net.b.de>

        PR fortran/37400
        * symbol.c (gfc_set_default_type): Copy char len.

2008-09-07  Tobias Burnus  <burnus@net.b.de>

        PR fortran/37400
        * gfortran.dg/implicit_12.f90: New test.

From-SVN: r140100

gcc/fortran/ChangeLog
gcc/fortran/symbol.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/implicit_12.f90 [new file with mode: 0644]

index 0e64d91..f80f6a0 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-08  Tobias Burnus  <burnus@net.b.de>
+
+       PR fortran/37400
+       * symbol.c (gfc_set_default_type): Copy char len.
+
 2008-09-06  Steven G. Kargl  <kargls@comcast.net>
 
        PR fortran/36153
index 0b58079..905b243 100644 (file)
@@ -257,6 +257,12 @@ gfc_set_default_type (gfc_symbol *sym, int error_flag, gfc_namespace *ns)
   sym->ts = *ts;
   sym->attr.implicit_type = 1;
 
+  if (ts->cl)
+    {
+      sym->ts.cl = gfc_get_charlen ();
+      *sym->ts.cl = *ts->cl;
+    }
+
   if (sym->attr.is_bind_c == 1)
     {
       /* BIND(C) variables should not be implicitly declared.  */
index 1855575..af93d15 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-08  Tobias Burnus  <burnus@net.b.de>
+
+       PR fortran/37400
+       * gfortran.dg/implicit_12.f90: New test.
+
 2008-09-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        PR fortran/37203
@@ -7,7 +12,7 @@
        * gfortran.d/reshape_order_4.f90:  New test case.
 
 2008-09-07  Richard Guenther  <rguenther@suse.de>
-            Ira Rosen  <irar@il.ibm.com>
+           Ira Rosen  <irar@il.ibm.com>
 
        PR tree-optimization/36630
        * gcc.dg/vect/pr36630.c: New test.
@@ -18,7 +23,7 @@
        related to PURE and statement functions.
 
 2008-09-07  Dorit Nuzman  <dorit@il.ibm.com>
-            Ira Rosen  <irar@il.ibm.com>
+           Ira Rosen  <irar@il.ibm.com>
 
        PR tree-optimization/35642
        * lib/target-supports.exp (check_effective_target_vect_short_mult):
@@ -35,7 +40,7 @@
 2008-09-06  Jeff Law <law@redhat.com>
 
        * gcc.c-torture/execute/memcpy-bi.c: Include <string.h>
+
 2008-09-06  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/37399
diff --git a/gcc/testsuite/gfortran.dg/implicit_12.f90 b/gcc/testsuite/gfortran.dg/implicit_12.f90
new file mode 100644 (file)
index 0000000..8136a18
--- /dev/null
@@ -0,0 +1,23 @@
+! { dg-do run}
+!
+! PR fortran/37400
+!
+module mod 
+   implicit character(len=*,kind=kind('A')) (Q) 
+   parameter(Q1 = '12345678')     ! len=8
+   parameter(Q2 = 'abcdefghijkl') ! len=12
+   contains 
+      subroutine sub(Q3) 
+         if(len('#'//Q3//'#') /= 15) call abort()
+         if('#'//Q3//'#' /= '#ABCDEFGHIJKLM#') call abort()
+      end subroutine sub 
+end module mod 
+program startest 
+   use mod 
+   implicit none
+   if(len('#'//Q1//'#') /= 10) call abort()
+   if(len('#'//Q2//'#') /= 14) call abort()
+   if('#'//Q1//'#' /='#12345678#') call abort()
+   if('#'//Q2//'#' /='#abcdefghijkl#') call abort()
+   call sub('ABCDEFGHIJKLM') ! len=13
+end program startest