This is an archive of the discontinued LLVM Phabricator instance.

[flang] Catch bad usage of POINTER attribute
ClosedPublic

Authored by klausler on Dec 15 2022, 11:25 AM.

Details

Summary

Most attributes apply to only object or only procedure entities,
and attempts to apply them to other kinds of symbol table entries
are caught in name resolution when ConvertToObjectEntity() or
ConvertToProcEntity() fails. However, the POINTER attribute can
be applied to both, and name resolution can't perform that conversion
yet, and as a result we don't catch many kinds of silly errors.
Fix by ensuring that the symbol is of a type that could eventually
become an object or procedure entity if it is not one already.

Diff Detail

Event Timeline

klausler created this revision.Dec 15 2022, 11:25 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Dec 15 2022, 11:25 AM
PeteSteinfeld accepted this revision.Dec 15 2022, 1:02 PM

All builds and tests correctly and looks good.

This revision is now accepted and ready to land.Dec 15 2022, 1:02 PM
This revision was automatically updated to reflect the committed changes.