[all-commits] [llvm/llvm-project] 81d857: [flang][NFC] Document ambiguous case of DATA in BLOCK

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Sep 22 18:25:16 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 81d857d037b53cb7abf4ef091e9ba6ec007b5809
      https://github.com/llvm/llvm-project/commit/81d857d037b53cb7abf4ef091e9ba6ec007b5809
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-09-22 (Thu, 22 Sep 2022)

  Changed paths:
    M flang/docs/Extensions.md

  Log Message:
  -----------
  [flang][NFC] Document ambiguous case of DATA in BLOCK

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.

Differential Revision: https://reviews.llvm.org/D134391




More information about the All-commits mailing list