Skip to content

[Flang] GENERIC INTERFACE: BINC(C) attribute not propagate to the generic name that is the same as the specific name that has the BIND(C) attribute.  #82267

@DanielCChen

Description

@DanielCChen

Consider the following code:

  MODULE M
  USE ISO_C_BINDING

  INTERFACE ExtFun
    FUNCTION ExtFun() BIND(C)
    IMPORT
      INTEGER(C_INT) :: ExtFun
    END FUNCTION
  END INTERFACE

  END MODULE

  PROGRAM MAIN
  USE M
  PROCEDURE(ExtFun), BIND(C), POINTER :: PExtFun
  END

Flang currently issues an error as:

: error: An interface name with BIND attribute must be specified if the BIND attribute is specified in a procedure declaration statement
    PROCEDURE(ExtFun), BIND(C), POINTER :: PExtFun
                                           ^^^^^^^

It passes if I remove the generic name. The BIND(C) attribute seems missing from both the generic and specific symbol in the dump.

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorflang:frontend

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions