This is an archive of the discontinued LLVM Phabricator instance.

[flang] Don't resolve component names to components in derived-type definition scope
ClosedPublic

Authored by klausler on Oct 28 2022, 2:37 PM.

Details

Reviewers
PeteSteinfeld
Summary

We implemented 19.3.4p1 literally in name resolution:

A component name has the scope of its derived-type definition. Outside the type definition,
it may also appear within a designator of a component of a structure of that type or as a
component keyword in a structure constructor for that type.

and within the derived-type definition would resolve the "bare"
names of components in specification inquiries and other contexts to
those components, not to any symbols in the enclosing scopes.

It turns out that most Fortran compilers resolve only "bare" names thus
when they are type parameters, and the names of data and procedure components
do not shadow exterior symbols. Adjust name resolution to follow that
precedent rather than what seems to be clear language in the standard.

Diff Detail

Event Timeline

klausler created this revision.Oct 28 2022, 2:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2022, 2:37 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Oct 28 2022, 2:37 PM
PeteSteinfeld accepted this revision.Oct 28 2022, 3:14 PM

All builds and tests correctly and looks good.

This revision is now accepted and ready to land.Oct 28 2022, 3:14 PM
klausler closed this revision.Oct 30 2022, 3:06 PM