File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -2691,6 +2691,10 @@ SpecificCall IntrinsicProcTable::Implementation::HandleNull(
2691
2691
mold = nullptr ;
2692
2692
}
2693
2693
if (mold) {
2694
+ if (IsAssumedRank (*arguments[0 ])) {
2695
+ context.messages ().Say (arguments[0 ]->sourceLocation (),
2696
+ " MOLD= argument to NULL() must not be assumed-rank" _err_en_US);
2697
+ }
2694
2698
bool isProcPtrTarget{
2695
2699
IsProcedurePointerTarget (*mold) && !IsNullObjectPointer (*mold)};
2696
2700
if (isProcPtrTarget || IsAllocatableOrPointerObject (*mold)) {
Original file line number Diff line number Diff line change @@ -151,10 +151,16 @@ subroutine s1(x)
151
151
subroutine s2 (x )
152
152
type (pdt(* )), pointer , intent (in ) :: x
153
153
end
154
- subroutine test
154
+ subroutine s3 (ar )
155
+ real , pointer :: ar(..)
156
+ end
157
+ subroutine test (ar )
158
+ real , pointer :: ar(..)
155
159
! ERROR: Actual argument associated with dummy argument 'x=' is a NULL() pointer without a MOLD= to provide a character length
156
160
call s1(null ())
157
161
! ERROR: Actual argument associated with dummy argument 'x=' is a NULL() pointer without a MOLD= to provide a value for the assumed type parameter 'n'
158
162
call s2(null ())
163
+ ! ERROR: MOLD= argument to NULL() must not be assumed-rank
164
+ call s3(null (ar))
159
165
end
160
166
end
You can’t perform that action at this time.
0 commit comments