This is an archive of the discontinued LLVM Phabricator instance.

[flang] Handle structure constructors with forward references to PDTs
ClosedPublic

Authored by PeteSteinfeld on Apr 26 2021, 3:22 PM.

Details

Summary

We were not correctly handling structure constructors that had forward
references to parameterized derived types. I harvested the code that checks
for forward references that was used during analysis of function call
expressions and called it from there and also called it during the
analysis of structure constructors.

I also added a test that will produce an internal error without this change.

Diff Detail

Event Timeline

PeteSteinfeld requested review of this revision.Apr 26 2021, 3:22 PM
PeteSteinfeld created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2021, 3:22 PM
PeteSteinfeld added a project: Restricted Project.Apr 26 2021, 3:23 PM
klausler accepted this revision.Apr 27 2021, 10:00 AM

Looks great apart from my naming nit.

flang/include/flang/Semantics/expression.h
385

Since this member function can emit a Message, it's not just a predicate; a name with "Check" would be better.

This revision is now accepted and ready to land.Apr 27 2021, 10:00 AM