File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -924,16 +924,19 @@ static PreparedDummyArgument preparePresentUserCallActualArgument(
924
924
if (hlfir::isFortranProcedureValue (dummyType)) {
925
925
// Procedure pointer or function returns procedure pointer actual to
926
926
// procedure dummy.
927
- if (actual.isProcedurePointer () ||
928
- actual.getType ().isa <fir::BoxProcType>()) {
927
+ if (actual.isProcedurePointer ()) {
929
928
actual = hlfir::derefPointersAndAllocatables (loc, builder, actual);
930
929
return PreparedDummyArgument{actual, /* cleanups=*/ {}};
931
930
}
932
931
// Procedure actual to procedure dummy.
933
932
assert (actual.isProcedure ());
934
933
// Do nothing if this is a procedure argument. It is already a
935
934
// fir.boxproc/fir.tuple<fir.boxproc, len> as it should.
936
- if (actual.getType () != dummyType)
935
+ if (!actual.getType ().isa <fir::BoxProcType>() &&
936
+ actual.getType () != dummyType)
937
+ // The actual argument may be a procedure that returns character (a
938
+ // fir.tuple<fir.boxproc, len>) while the dummy is not. Extract the tuple
939
+ // in that case.
937
940
actual = fixProcedureDummyMismatch (loc, builder, actual, dummyType);
938
941
return PreparedDummyArgument{actual, /* cleanups=*/ {}};
939
942
}
You can’t perform that action at this time.
0 commit comments