[J3] [EXTERNAL] Can a disassociated pointer invoke a type-bound procedure?

Reuben D. Budiardja reubendb at ornl.gov
Thu Jun 12 18:08:15 UTC 2025


Hi Daniel,

I think 8.5.12 para 2: "A data pointer shall not be referenced unless it 
is pointer associated with a target object that is defined"
would make this illegal.

Best,
Reuben


On 6/12/25 12:37, Daniel Chen via J3 wrote:
> In the following code, pointer “b1” is not associated with any target. 
> Is it conforming for “b1” to invoke the type-bound procedure of its 
> type? ``` module m1 type base integer :: id contains procedure, nopass 
> :: type => basetype end type
> 
> 
> In the following code, pointer “b1” is not associated with any target. 
> Is it conforming for “b1” to invoke the type-bound procedure of its type?
> 
> ```
> module m1
> 
>     type base
> 
>        integer :: id
> 
>     contains
> 
>        procedure, nopass :: type => basetype
> 
>     end type
> 
> contains
> 
>     integer function basetype()
> 
>        basetype = 1
> 
>     end function
> 
> end module
> 
> use m1
> 
> type(base), pointer :: b1 => null()
> 
> print*, b1%type()
> 
> end
> ```
> 
> Thanks,
> Daniel
> 



More information about the J3 mailing list