[J3] Standard conformance of parameterized derived type usage
William Clodius
w.clodius at icloud.com
Tue Nov 10 20:04:54 EST 2020
ThaNKS. Now suppose the initialization to a null pointer is omitted is it standard conforming etc.?
> On Nov 10, 2020, at 5:52 PM, Malcolm Cohen via J3 <j3 at mailman.j3-fortran.org> wrote:
>
> No, it is not conforming, it violates a constraint:
>
> C762 (R737) If component-initialization appears, every type parameter and
> array bound of the component shall be a colon or constant expression.
>
> Cheers,
> --
> ..............Malcolm Cohen, NAG Oxford/Tokyo.
>
> -----Original Message-----
> From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of William Clodius
> via J3
> Sent: Wednesday, November 11, 2020 9:36 AM
> To: General J3 interest list <j3 at mailman.j3-fortran.org>
> Cc: William Clodius <w.clodius at icloud.com>
> Subject: [J3] Standard conformance of parameterized derived type usage
>
> Is the following program standard conforming?
>
> PROGRAM TEST_LEN_PARAMETER
> IMPLICIT NONE
> TYPE :: T(N)
> iNTEGER, LEN :: N
> TYPE(T(N+1)), POINTER :: P => NULL()
> END TYPE T
> TYPE(T(0)) :: A
> ALLOCATE(A % P)
> ALLOCATE(A % P % P)
> WRITE(*,'(A, I0)') 'A % N = ', A % N
> WRITE(*,'(A, I0)') 'A % P % N = ', A % P % N
> WRITE(*,'(A, I0)') 'A % P % P % N = ', A % P % P % N
> END PROGRAM TEST_LEN_PARAMETER
>
> If so what should be the output?
>
> If so are there any processors that successfully process the code?
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1619 bytes
Desc: not available
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20201110/8b1a2cc2/attachment.bin>
More information about the J3
mailing list