This is an archive of the discontinued LLVM Phabricator instance.

[flang][NFC] Document ambiguous case of DATA in BLOCK
ClosedPublic

Authored by klausler on Sep 21 2022, 3:05 PM.

Details

Summary

Fortran is not clear about the semantics of

subroutine subr
  integer n = 1
  block
    data n/2/
  end block
end subroutine

which could be interpreted as having two variables, each
named 'n', or as having one variable 'n' with invalid double
initialization. Precedents from existing compilers are also
in disagreement.

The most common interpretation, however, agrees with a subtle
reading of the standard: BLOCK constructs scope names that have
local specifications, and a DATA statement is a declaration
construct, not a specification construct. So this example is
*not* acceptable.

Diff Detail

Event Timeline

klausler created this revision.Sep 21 2022, 3:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2022, 3:05 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Sep 21 2022, 3:05 PM
This revision is now accepted and ready to land.Sep 21 2022, 11:58 PM
This revision was landed with ongoing or failed builds.Sep 22 2022, 6:25 PM
This revision was automatically updated to reflect the committed changes.