This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR44265 - Link error with reference to parameter array in specification expression
- From: Dominique d'Humières <dominiq at lps dot ens dot fr>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Ian Harvey <ian_harvey at bigpond dot com>
- Date: Wed, 9 Nov 2016 22:06:27 +0100
- Subject: Re: [Patch, fortran] PR44265 - Link error with reference to parameter array in specification expression
- Authentication-results: sourceware.org; auth=none
- References: <CAGkQGiKhuq2Pw0T8URCD3ZiA-hDpmXZZr4kJvg8PZQdCoORSWw@mail.gmail.com> <8599BDBA-59DD-4798-B704-E28DC89206E2@lps.ens.fr> <CAGkQGiJrm2r0uRpe9eLBn+yQrC0zfy+oxoriy0GDPU07GJ=iug@mail.gmail.com>
> Le 9 nov. 2016 à 20:09, Paul Richard Thomas <paul.richard.thomas@gmail.com> a écrit :
>
> Dear Dominique,
>
> I am deeply embarrassed. This is the consequence of an additional
> condition added at the last minute.
No reason to be embarrassed;-)
> The attached removes it and makes sure that the original bug is tested
> in char_result_14.f90. The ChangeLogs are the same.
>
> OK for trunk?
IMO yes
>
> Paul
>
I have a last glitch (which can be deferred if needed):
FUNCTION Get(i) RESULT(s)
CHARACTER(*), PARAMETER :: names(3) = [ &
'Apple ', &
'Orange ', &
'Mango ' ];
INTEGER, INTENT(IN) :: i
CHARACTER(LEN_TRIM(names(i))) :: s
!****
s = names(i)
print *, len(s)
END FUNCTION Get
PROGRAM WheresThatbLinkingConstantGone
IMPLICIT NONE
interface
FUNCTION Get(i) RESULT(s)
CHARACTER(*), PARAMETER :: names(3) = [ &
'Apple ', &
'Orange ', &
'Mango ' ];
INTEGER, INTENT(IN) :: i
CHARACTER(LEN_TRIM(names(i))) :: s
END FUNCTION Get
end interface
integer :: i
i = len(Get(1))
print *, i
END PROGRAM WheresThatbLinkingConstantGone
does not link.
Dominique