re PR fortran/22273 (problem to declare a character variable link to an intent(out...
authorErik Edelmann <erik.edelmann@iki.fi>
Sun, 16 Oct 2005 13:59:36 +0000 (16:59 +0300)
committerTobias Schlüter <tobi@gcc.gnu.org>
Sun, 16 Oct 2005 13:59:36 +0000 (15:59 +0200)
2005-10-16  Erik Edelmann  <erik.edelmann@iki.fi>
fortran/
PR 22273
* expr.c (check_inquiry): Add "len" to inquiry_function.
testsuite/
PR fortran/22273
* gfortran.dg/spec_expr_2.f90: New.

From-SVN: r105460

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

index 7f263753b7e9a6d078a07dd0305be430ba210064..dca2ef287d5d529f174b791471619ad4f412b0ca 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-16  Erik Edelmann  <erik.edelmann@iki.fi>
+
+       PR 22273
+       * expr.c (check_inquiry): Add "len" to inquiry_function.
+
 2005-10-14  Jakub Jelinek  <jakub@redhat.com>
 
        * primary.c (match_boz_constant): Add missing break after gfc_error.
index 78b811a628b3b66736ddc851733a5c4d3f384fbb..16d35c4edb0faf533d36a224c6412dc62104da2b 100644 (file)
@@ -1355,7 +1355,7 @@ check_inquiry (gfc_expr * e)
   /* FIXME: This should be moved into the intrinsic definitions,
      to eliminate this ugly hack.  */
   static const char * const inquiry_function[] = {
-    "digits", "epsilon", "huge", "kind", "maxexponent", "minexponent",
+    "digits", "epsilon", "huge", "kind", "len", "maxexponent", "minexponent",
     "precision", "radix", "range", "tiny", "bit_size", "size", "shape",
     "lbound", "ubound", NULL
   };
@@ -1376,10 +1376,9 @@ check_inquiry (gfc_expr * e)
   if (e == NULL || e->expr_type != EXPR_VARIABLE)
     return FAILURE;
 
-  /* At this point we have a numeric inquiry function with a variable
-     argument.  The type of the variable might be undefined, but we
-     need it now, because the arguments of these functions are allowed
-     to be undefined.  */
+  /* At this point we have an inquiry function with a variable argument.  The
+     type of the variable might be undefined, but we need it now, because the
+     arguments of these functions are allowed to be undefined.  */
 
   if (e->ts.type == BT_UNKNOWN)
     {
index acfcdb69212a78d846cd4bdd1669ff42cf1240dd..0d4bd73a578e5b3008f0ea66a222168b38620c24 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-16  Erik Edelmann  <erik.edelmann@iki.fi>
+
+       PR fortran/22273
+       * gfortran.dg/spec_expr_2.f90: New.
+
 2005-10-16  Hans-Peter Nilsson  <hp@axis.com>
 
        * g++.dg/debug/debug3.C, g++.dg/ext/visibility/noPLT.C,
diff --git a/gcc/testsuite/gfortran.dg/spec_expr_2.f90 b/gcc/testsuite/gfortran.dg/spec_expr_2.f90
new file mode 100644 (file)
index 0000000..5b0500d
--- /dev/null
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR 22273: Allow INTENT(OUT) dummy:s as arguments to LEN() in specification
+! expr:s
+subroutine lecligne (ligne)
+    character(len=*), intent(out) :: ligne
+    character(len=len(ligne)) :: comment
+end subroutine lecligne