re PR fortran/31540 ([Regression 4.2 only] character((constant expression)) for exter...
authorPaul Thomas <pault@gcc.gnu.org>
Sun, 6 May 2007 15:12:01 +0000 (15:12 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Sun, 6 May 2007 15:12:01 +0000 (15:12 +0000)
2007-05-06  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/31540
* resolve.c (resolve_fl_procedure): Resolve constant character
lengths.

2007-05-06  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/31540
* gfortran.dg/char_result_4.f90: New test.

From-SVN: r124475

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog

index 9435165ffc30227908e7d6ea64365029aca19724..361ffcc04be98e37851c8798ffbc8697a9c22559 100644 (file)
@@ -1,3 +1,9 @@
+2007-05-06  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/31540
+       * resolve.c (resolve_fl_procedure): Resolve constant character
+       lengths.
+
 2007-05-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/31251
index 55f1390d03b3ff9f07ab64bced8d4708b135b2e6..4ec9a921c4ac6dc15eb27c297450e6d1faead257 100644 (file)
@@ -5812,6 +5812,11 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
   if (sym->ts.type == BT_CHARACTER)
     {
       gfc_charlen *cl = sym->ts.cl;
+
+      if (cl && cl->length && gfc_is_constant_expr (cl->length)
+            && resolve_charlen (cl) == FAILURE)
+       return FAILURE;
+
       if (!cl || !cl->length || cl->length->expr_type != EXPR_CONSTANT)
        {
          if (sym->attr.proc == PROC_ST_FUNCTION)
index bcec964d959e619f1edd68260a8f5a9a68ef2428..2b74f7cc8f842c561f3df00917b37ed5ae419cf7 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-06  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/31540
+       * gfortran.dg/char_result_4.f90: New test.
+
 2007-06-05  Revital Eres  <eres@il.ibm.com>
        
        PR 30957