This is an archive of the discontinued LLVM Phabricator instance.

[flang] Another validity of the TARGET= argument of ASSOCIATED() for objects
ClosedPublic

Authored by PeteSteinfeld on Oct 19 2020, 11:06 AM.

Details

Summary

In my previous implementation of the semantic checks for ASSOCIATED(), I
had neglected to check the TARGET= argument for objects to ensure that
it has either the POINTER or TARGET attributes.

I added an implementation and a test.

Diff Detail

Event Timeline

PeteSteinfeld created this revision.Oct 19 2020, 11:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2020, 11:06 AM
PeteSteinfeld requested review of this revision.Oct 19 2020, 11:06 AM
PeteSteinfeld added a project: Restricted Project.Oct 19 2020, 11:15 AM

Why is this a fatal error, rather than a warning? If the TARGET= argument lacks both POINTER and TARGET attributes, the result will always be false, and we can warn about that.

Why is this a fatal error, rather than a warning? If the TARGET= argument lacks both POINTER and TARGET attributes, the result will always be false, and we can warn about that.

This same logic applies to all invalid TARGET= arguments. GNU, pgf90, IBM, Intel, and NAG all consider this an error. I think that we should. too.

klausler accepted this revision.Oct 21 2020, 9:52 AM
This revision is now accepted and ready to land.Oct 21 2020, 9:52 AM