2020-05-12 02:38:53 +08:00
|
|
|
! RUN: %S/test_errors.sh %s %t %f18
|
2019-04-08 15:26:10 +08:00
|
|
|
! Check for semantic errors in NULLIFY statements
|
|
|
|
|
2019-04-08 02:29:48 +08:00
|
|
|
INTEGER, PARAMETER :: maxvalue=1024
|
|
|
|
|
|
|
|
Type dt
|
|
|
|
Integer :: l = 3
|
|
|
|
End Type
|
|
|
|
Type t
|
|
|
|
Type(dt) :: p
|
|
|
|
End Type
|
|
|
|
|
|
|
|
Type(t),Allocatable :: x(:)
|
|
|
|
|
|
|
|
Integer :: pi
|
|
|
|
Procedure(Real) :: prp
|
|
|
|
|
|
|
|
Allocate(x(3))
|
2019-04-08 15:26:10 +08:00
|
|
|
!ERROR: component in NULLIFY statement must have the POINTER attribute
|
2019-04-08 02:29:48 +08:00
|
|
|
Nullify(x(2)%p)
|
|
|
|
|
2019-04-08 15:26:10 +08:00
|
|
|
!ERROR: name in NULLIFY statement must have the POINTER attribute
|
2019-04-08 02:29:48 +08:00
|
|
|
Nullify(pi)
|
|
|
|
|
2019-04-08 15:26:10 +08:00
|
|
|
!ERROR: name in NULLIFY statement must have the POINTER attribute
|
2019-04-08 02:29:48 +08:00
|
|
|
Nullify(prp)
|
|
|
|
|
2019-04-08 15:26:10 +08:00
|
|
|
!ERROR: name in NULLIFY statement must be a variable or procedure pointer name
|
2019-04-08 02:29:48 +08:00
|
|
|
Nullify(maxvalue)
|
|
|
|
|
|
|
|
End Program
|