summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-18 08:34:42 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-18 08:34:42 +0000
commit34989da61c0b389079a834f8c599015c869ba428 (patch)
treeb72ad2f3086f63d2bd98f124757c97fdf7373a63 /gcc/fortran/trans-array.c
parentb976cd16eac44a5059667263340266473b3c071d (diff)
downloadgcc-34989da61c0b389079a834f8c599015c869ba428.tar.gz
2007-08-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32875 * trans-array.c (get_array_ctor_strlen): Set the character length of a zero length array to zero. 2007-08-18 Paul Thomas <pault@gcc.gnu.org> PR fortran/32875 * gfortran.dg/array_constructor_18.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127608 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 31d177bdbf6..f6b4751fb7c 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -1421,6 +1421,13 @@ get_array_ctor_strlen (stmtblock_t *block, gfc_constructor * c, tree * len)
bool is_const;
is_const = TRUE;
+
+ if (c == NULL)
+ {
+ *len = build_int_cstu (gfc_charlen_type_node, 0);
+ return is_const;
+ }
+
for (; c; c = c->next)
{
switch (c->expr->expr_type)