summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-16 13:59:36 +0000
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-16 13:59:36 +0000
commitec7d1569362ff61904f7d618062fd00b89fc63f4 (patch)
tree5a62c2ecc9f5536003336480d28af0859099b33d
parent22041d3fafbeaf76d756a28ddba0cbc1e2fd4a08 (diff)
downloadgcc-ec7d1569362ff61904f7d618062fd00b89fc63f4.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105460 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/expr.c9
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/spec_expr_2.f907
4 files changed, 21 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 7f263753b7e..dca2ef287d5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -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.
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 78b811a628b..16d35c4edb0 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -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)
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index acfcdb69212..0d4bd73a578 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 00000000000..5b0500d735b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/spec_expr_2.f90
@@ -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