Message ID | daeec535-92a3-edc4-8bf8-157509115202@netcologne.de |
---|---|
State | New |
Headers | show |
Series | [fortran] Fix PR 87673, rejects-valid | expand |
On Sun, Mar 10, 2019 at 09:04:18PM +0100, Thomas Koenig wrote: > ! { dg-do compile } > ! PR 87673 - used to cause errors about non-pure functions. > ! A fragment from Richard Townsend's iso_varying_string, as modified by > ! Ian Harvey to include F2003 language capabilities. For copyright notices > ! see source at http://www.megms.com.au/download/aniso_varying_string.f90 Copyright notice? If it isn't some version of gpl or lgpl, then you might need to either get approval from FSF, get Richard Townshend to put the code that demonstrate the code under a gpl compatible copyright, or rewrite the example that demonstrates the bug. BTW, I think Ian's bug report is actually a duplicate of another PR, but don't recall which one.
Am 10.03.19 um 21:15 schrieb Steve Kargl: > On Sun, Mar 10, 2019 at 09:04:18PM +0100, Thomas Koenig wrote: > >> ! { dg-do compile } >> ! PR 87673 - used to cause errors about non-pure functions. >> ! A fragment from Richard Townsend's iso_varying_string, as modified by >> ! Ian Harvey to include F2003 language capabilities. For copyright notices >> ! see source at http://www.megms.com.au/download/aniso_varying_string.f90 > > Copyright notice? This is what I copied from the PR. > If it isn't some version of gpl or lgpl, then you might need > to either get approval from FSF, get Richard Townshend to > put the code that demonstrate the code under a gpl compatible > copyright, or rewrite the example that demonstrates the bug. You're probably right, I will fix this. Ugh... > BTW, I think Ian's bug report is actually a duplicate of > another PR, but don't recall which one. It was marked as a duplicate of PR 87734, but I unmarked it because PR 87734 is fixed on trunk and this one is not :-) Regards Thomas
Am 10.03.19 um 22:12 schrieb Thomas Koenig:
> You're probably right, I will fix this. Ugh...
OK, so here is the updated test case, without the copyright stuff.
OK for trunk now? :-)
Regards
Thomas
! { 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
On Sun, Mar 10, 2019 at 10:36:48PM +0100, Thomas Koenig wrote: > Am 10.03.19 um 22:12 schrieb Thomas Koenig: > > > You're probably right, I will fix this. Ugh... > > OK, so here is the updated test case, without the copyright stuff. > > OK for trunk now? :-) > Yes. Thanks for patch.
Index: match.c =================================================================== --- match.c (Revision 269552) +++ match.c (Arbeitskopie) @@ -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;