This is an archive of the discontinued LLVM Phabricator instance.

[flang] Complain about more cases of calls to insufficiently defined procedures
ClosedPublic

Authored by klausler on Jun 15 2021, 4:05 PM.

Details

Summary

When a function is called in a specification expression, it must be
sufficiently defined, and cannot be a recursive call (10.1.11(5)).
The best fix for this is to change the contract for the procedure
characterization infrastructure to catch and report such errors,
and to guarantee that it does emit errors on failed characterizations.
Some call sites were adjusted to avoid cascades.

Diff Detail

Event Timeline

klausler created this revision.Jun 15 2021, 4:05 PM
klausler requested review of this revision.Jun 15 2021, 4:05 PM
PeteSteinfeld requested changes to this revision.Jun 15 2021, 9:03 PM

Things build OK, but I when I run the tests, I get failures in implicit07.f90 and resolve29.f90.

Also, I wonder about the two identical error messages in characteristics.cpp.

flang/lib/Evaluate/characteristics.cpp
473–475

Is this the error message that you meant to use for something that has EntityDetails? In particular, this message is identical to the message below for something with SubprogramNameDetails.

This revision now requires changes to proceed.Jun 15 2021, 9:03 PM

Things build OK, but I when I run the tests, I get failures in implicit07.f90 and resolve29.f90.

Also, I wonder about the two identical error messages in characteristics.cpp.

I think that those failures are due to a dependence on other changes; they're now merged, and those tests should now pass for you like they do for me.

It's okay that those two cases (EntityDetails and SubprogramNameDetails) emit the same message.

PeteSteinfeld accepted this revision.Jun 16 2021, 2:59 PM

In my latest attempt to build and test this, .../test/Semantics/call19.f90 is failing because it's producing extra messages regarding entities that are "not a procedure". But I trust you to make sure that everything works after integration with the latest sources.

This revision is now accepted and ready to land.Jun 16 2021, 2:59 PM
This revision was landed with ongoing or failed builds.Jun 16 2021, 6:21 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2021, 6:21 PM