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
This commit is contained in:
Paul Thomas 2007-08-18 08:34:42 +00:00
parent 94cf78d30d
commit 58fbb917c9
4 changed files with 37 additions and 0 deletions

View file

@ -1,3 +1,9 @@
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>
PR fortran/33072

View file

@ -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)

View file

@ -1,3 +1,8 @@
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>
PR c++/28989

View file

@ -0,0 +1,19 @@
! { 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