[all-commits] [llvm/llvm-project] 2d6e28: [flang] Support C1553 about BIND(C) function result

PeixinQiao via All-commits all-commits at lists.llvm.org
Wed Jan 11 04:57:22 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d6e280223cca4e44882245feb06e0c50d4c6375
      https://github.com/llvm/llvm-project/commit/2d6e280223cca4e44882245feb06e0c50d4c6375
  Author: Peixin Qiao <qiaopeixin at huawei.com>
  Date:   2023-01-11 (Wed, 11 Jan 2023)

  Changed paths:
    M flang/lib/Semantics/check-declarations.cpp
    A flang/test/Semantics/bind-c09.f90

  Log Message:
  -----------
  [flang] Support C1553 about BIND(C) function result

As Fortran 2018 C1553, if with BIND(C), the function result shall be an
interoperable scalar variable. As Fortran 2018 18.3.4(1), the
interoperable scalar variable is not a coarray, has neither the
ALLOCATABLE nor the POINTER attribute, and if it is of type character its
length is not assumed or declared by an expression that is not a constant
expression.

As Fortran 2018 18.3.1(1), if the type is character, the length type
parameter is interoperable if and only if its value is one.

Reviewed By: PeteSteinfeld, jeanPerier

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




More information about the All-commits mailing list