https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49802

Harald Anlauf <anlauf at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #12 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #11)
> As far as I can tell, this has since been fixed. I checked the various cases
> in the comments. C3 will run correctly if the code is fixed.
> 
> implicit none
> character(len=10) :: str
> 
> str = "123456789"
> call by_value(str)
> print *, str
> if (str /= "123456789") call abort()
> 
> contains
>   subroutine by_value(y)
>    !character(len=*), value :: y ------ Not allowed with value
>     character(len=10), value :: y
> 
>     print *, len(y)
>     if (len(y) /= 10) call abort()
>     print *, y
>     y = "abcdefghij"
>     print *, y
>    !if (str /= "abcdefghij") call abort() ------- Bogus test
>     if (y /= "abcdefghij") call abort()
> 
>   end subroutine
> end
> 
> Closing as fixed

Jerry, assumed length is valid, at least in F2023:8.5.19.

Reopening.

Reply via email to