This is an archive of the discontinued LLVM Phabricator instance.

[flang] Check for attributes specific to dummy arguments
ClosedPublic

Authored by PeteSteinfeld on Apr 22 2021, 7:30 PM.

Details

Summary

We were not checking that attributes that are supposed to be specific to
dummy arguments were not being used for local entities. I added the checks
along with tests for them.

After implementing these new checks, I found that one of the tests in
separate-mp02.f90 was erroneous, and I fixed it.

Diff Detail

Event Timeline

PeteSteinfeld requested review of this revision.Apr 22 2021, 7:30 PM
PeteSteinfeld created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2021, 7:30 PM
PeteSteinfeld added a project: Restricted Project.Apr 22 2021, 7:31 PM
tskeith accepted this revision.Apr 23 2021, 7:19 AM
tskeith added inline comments.
flang/test/Semantics/resolve58.f90
78

There are already checks for the VALUE attribute, but the message is worded differently. It would be better if they were consistent.

t.f90:2:21: error: VALUE attribute may apply only to a dummy argument
    integer, value :: x
                      ^
t.f90:3:24: error: OPTIONAL attribute can only be used for dummy arguments
    integer, optional :: y
                         ^
This revision is now accepted and ready to land.Apr 23 2021, 7:19 AM

Fixed the error messages as recommended by Tim.