@@ -276,12 +276,15 @@ void ProcedureRef::DetermineCopyInOut() {
276
276
if (!procInfo) {
277
277
return ;
278
278
}
279
- // TODO: at this point have dummy arguments as procInfo->dummyArguments
280
- // and have actual arguments via arguments_
281
-
282
- // TODO: implicitly declared procedure may not have any information about
283
- // its dummy args. Handle this case.
284
-
279
+ if (!procInfo->HasExplicitInterface ()) {
280
+ for (auto &actual : arguments_) {
281
+ if (!actual) {
282
+ continue ;
283
+ }
284
+ DetermineCopyInOutArgument (*procInfo, *actual);
285
+ }
286
+ return ;
287
+ }
285
288
// Don't change anything about actual or dummy arguments, except for
286
289
// computing copy-in/copy-out information. If detect something wrong with
287
290
// the arguments, stop processing and let semantic analysis generate the
@@ -308,7 +311,13 @@ void ProcedureRef::DetermineCopyInOut() {
308
311
}
309
312
else {
310
313
processedKeywords.insert (actualName);
311
-
314
+ if (auto it = std::find_if (procInfo->dummyArguments .begin (),
315
+ procInfo->dummyArguments .end (),
316
+ [&](const characteristics::DummyArgument &dummy) {
317
+ return dummy.name == actualName;
318
+ }); it != procInfo->dummyArguments .end ()) {
319
+ DetermineCopyInOutArgument (*procInfo, *actual, *it);
320
+ }
312
321
}
313
322
}
314
323
else if (seenKeyword) {
@@ -318,6 +327,8 @@ void ProcedureRef::DetermineCopyInOut() {
318
327
}
319
328
else {
320
329
// Positional argument processing
330
+ DetermineCopyInOutArgument (*procInfo, *actual,
331
+ procInfo->dummyArguments [index]);
321
332
}
322
333
323
334
++index;
0 commit comments