re PR fortran/87673 (Errors caused by using function for character length in allocate with typespec)
2019-03-12 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/87673 * match.c (gfc_match_type_spec): Remove call to gfc_resolve_expr for character length. 2019-03-12 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/87673 * gfortran.dg/charlen_17.f90: New test. From-SVN: r269624
This commit is contained in:
parent
6684d2dbff
commit
1eabf876d5
@ -1,3 +1,9 @@
|
||||
2019-03-12 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/87673
|
||||
* match.c (gfc_match_type_spec): Remove call to
|
||||
gfc_resolve_expr for character length.
|
||||
|
||||
2019-03-12 Martin Liska <mliska@suse.cz>
|
||||
|
||||
* decl.c (add_init_expr_to_sym): Replace usage of 'can't'
|
||||
|
@ -2122,8 +2122,6 @@ gfc_match_type_spec (gfc_typespec *ts)
|
||||
ts->type = BT_CHARACTER;
|
||||
|
||||
m = gfc_match_char_spec (ts);
|
||||
if (ts->u.cl && ts->u.cl->length)
|
||||
gfc_resolve_expr (ts->u.cl->length);
|
||||
|
||||
if (m == MATCH_NO)
|
||||
m = MATCH_YES;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2019-03-12 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/87673
|
||||
* gfortran.dg/charlen_17.f90: New test.
|
||||
|
||||
2019-03-12 Robin Dapp <rdapp@linux.ibm.com>
|
||||
|
||||
* gcc.target/s390/memset-1.c: Adapt test case for new scheduling.
|
||||
|
14
gcc/testsuite/gfortran.dg/charlen_17.f90
Normal file
14
gcc/testsuite/gfortran.dg/charlen_17.f90
Normal file
@ -0,0 +1,14 @@
|
||||
! { dg-do compile }
|
||||
! PR 87673 - used to cause errors about non-pure functions.
|
||||
|
||||
module x
|
||||
implicit none
|
||||
contains
|
||||
pure function foo() result(res)
|
||||
character(len=:), allocatable :: res
|
||||
allocate (character(bar()) :: res)
|
||||
end function foo
|
||||
pure integer function bar()
|
||||
bar = 1
|
||||
end function bar
|
||||
end module x
|
Loading…
Reference in New Issue
Block a user