Commit 58fbb917 by Paul Thomas

re PR fortran/32875 (Not Implemented: complex character array constructor)

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.

From-SVN: r127608
parent 94cf78d3
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-16 Tobias Burnus <burnus@net-b.de> 2007-08-16 Tobias Burnus <burnus@net-b.de>
PR fortran/33072 PR fortran/33072
......
...@@ -1421,6 +1421,13 @@ get_array_ctor_strlen (stmtblock_t *block, gfc_constructor * c, tree * len) ...@@ -1421,6 +1421,13 @@ get_array_ctor_strlen (stmtblock_t *block, gfc_constructor * c, tree * len)
bool is_const; bool is_const;
is_const = TRUE; is_const = TRUE;
if (c == NULL)
{
*len = build_int_cstu (gfc_charlen_type_node, 0);
return is_const;
}
for (; c; c = c->next) for (; c; c = c->next)
{ {
switch (c->expr->expr_type) switch (c->expr->expr_type)
......
2007-08-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32875
* gfortran.dg/array_constructor_18.f90: New test.
2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com> 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR c++/28989 PR c++/28989
! { dg-do compile }
! Tests the fix for PR32875, in which the character length for the
! array constructor would get lost in simplification and would lead
! the error 'Not Implemented: complex character array constructor'.
!
! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
!
call foo ((/(S1(i),i=1,3,-1)/))
CONTAINS
FUNCTION S1(i)
CHARACTER(LEN=1) :: S1
INTEGER :: I
S1="123456789"(i:i)
END FUNCTION S1
subroutine foo (chr)
character(1) :: chr(:)
print *, chr
end subroutine
END
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment