[all-commits] [llvm/llvm-project] eb1413: [flang] Correct interaction between generics and i...

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Apr 14 13:56:23 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: eb14135e35bf2463a5c52394f311d47c18d72dee
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-04-14 (Thu, 14 Apr 2022)

  Changed paths:
    M flang/lib/Semantics/check-declarations.cpp
    M flang/lib/Semantics/expression.cpp
    M flang/lib/Semantics/resolve-names.cpp
    A flang/test/Semantics/resolve109.f90

  Log Message:
  [flang] Correct interaction between generics and intrinsics

Fortran allows a generic interface to have he same name as an
intrinsic procedure.  If the intrinsic is explicitly marked with
the INTRINSIC attribute, restrictions apply (C848) - the generic
must contain only functions or subroutines, depending on the
intrinsic.  Explicit or not, the generic overrides the intrinsic,
but the intrinsic behavior must still be available for calls
whose actual arguments do not match any of the specific procedures.

Semantics was not checking constraint C848, and it didn't allow
an explicit INTRINSIC attribute on a name of a generic interface.

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

More information about the All-commits mailing list