[flang-commits] [PATCH] D95697: [flang] Support disabled alternative PARAMETER statement

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jan 29 13:36:38 PST 2021


klausler created this revision.
klausler added a reviewer: tskeith.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a reviewer: awarzynski.
klausler requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Legacy Fortran implementations support an alternative form of the
PARAMETER statement; it differs syntactically from the standard's
PARAMETER statement by lacking parentheses, and semantically by
using the type and shape of the initialization expression to define
the attributes of the named constant.  (GNU Fortran gets that part
wrong; Intel Fortran and nvfortran have full support.)

This patch disables the old style PARAMETER statement by default, as
it is syntactically ambiguous with conforming assignment statements;
adds a new "-falternative-parameter-statement" option to enable it;
and implements it correctly when enabled.

Fixes https://bugs.llvm.org/show_bug.cgi?id=48774, in which a user
tripped over the syntactic ambiguity.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95697

Files:
  flang/docs/Extensions.md
  flang/include/flang/Common/Fortran-features.h
  flang/include/flang/Semantics/scope.h
  flang/include/flang/Semantics/tools.h
  flang/lib/Evaluate/shape.cpp
  flang/lib/Semantics/resolve-names.cpp
  flang/lib/Semantics/scope.cpp
  flang/lib/Semantics/tools.cpp
  flang/lib/Semantics/type.cpp
  flang/test/Semantics/oldparam01.f90
  flang/test/Semantics/oldparam02.f90
  flang/test/Semantics/oldparam03.f90
  flang/tools/f18/f18.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95697.320205.patch
Type: text/x-patch
Size: 13377 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210129/99fa27c9/attachment.bin>


More information about the flang-commits mailing list