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(
26912691 mold = nullptr ;
26922692 }
26932693 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+ }
26942698 bool isProcPtrTarget{
26952699 IsProcedurePointerTarget (*mold) && !IsNullObjectPointer (*mold)};
26962700 if (isProcPtrTarget || IsAllocatableOrPointerObject (*mold)) {
Original file line number Diff line number Diff line change @@ -151,10 +151,16 @@ subroutine s1(x)
151151 subroutine s2 (x )
152152 type (pdt(* )), pointer , intent (in ) :: x
153153 end
154- subroutine test
154+ subroutine s3 (ar )
155+ real , pointer :: ar(..)
156+ end
157+ subroutine test (ar )
158+ real , pointer :: ar(..)
155159 ! ERROR: Actual argument associated with dummy argument 'x=' is a NULL() pointer without a MOLD= to provide a character length
156160 call s1(null ())
157161 ! 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'
158162 call s2(null ())
163+ ! ERROR: MOLD= argument to NULL() must not be assumed-rank
164+ call s3(null (ar))
159165 end
160166end
You can’t perform that action at this time.
0 commit comments