Page MenuHomePhabricator

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

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



Fortran is not clear about the semantics of

subroutine subr
  integer n = 1
    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.Wed, Sep 21, 3:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Sep 21, 3:05 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Wed, Sep 21, 3:05 PM
This revision is now accepted and ready to land.Wed, Sep 21, 11:58 PM
This revision was landed with ongoing or failed builds.Thu, Sep 22, 6:25 PM
This revision was automatically updated to reflect the committed changes.