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:
parent
94cf78d30d
commit
58fbb917c9
4 changed files with 37 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
19
gcc/testsuite/gfortran.dg/array_constructor_18.f90
Normal file
19
gcc/testsuite/gfortran.dg/array_constructor_18.f90
Normal 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
|
Loading…
Add table
Reference in a new issue