[all-commits] [llvm/llvm-project] ebe74d: [flang] Support disabled alternative PARAMETER sta...

Peter Klausler via All-commits all-commits at lists.llvm.org
Fri Jan 29 15:30:30 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ebe74d9592d097501f376c2086e58d35aa318896
      https://github.com/llvm/llvm-project/commit/ebe74d9592d097501f376c2086e58d35aa318896
  Author: peter klausler <pklausler at nvidia.com>
  Date:   2021-01-29 (Fri, 29 Jan 2021)

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

  Log Message:
  -----------
  [flang] Support disabled alternative PARAMETER statement

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.

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




More information about the All-commits mailing list