Files
clang-p2996/flang/test/Semantics/bind-c03.f90
Peter Klausler f4215f7140 [flang] Fix handling of shadowed procedure name used as interface (#82837)
Use BypassGeneric() to process the name of an interface in a procedure
declaration statement, so that if it's the name of a generic with a
homonymous specific procedure, that's what defines the interface.

Fixes https://github.com/llvm/llvm-project/issues/82267.
2024-03-01 16:42:00 -08:00

31 lines
892 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! Check for C1521
! If proc-language-binding-spec (bind(c)) is specified, the proc-interface
! shall appear, it shall be an interface-name, and interface-name shall be
! declared with a proc-language-binding-spec.
module m
interface
subroutine proc1() bind(c)
end
subroutine proc2()
end
end interface
interface proc3
subroutine proc3() bind(c)
end
end interface
procedure(proc1), bind(c) :: pc1 ! no error
procedure(proc3), bind(c) :: pc4 ! no error
!ERROR: An interface name with BIND attribute must be specified if the BIND attribute is specified in a procedure declaration statement
procedure(proc2), bind(c) :: pc2
!ERROR: An interface name with BIND attribute must be specified if the BIND attribute is specified in a procedure declaration statement
procedure(integer), bind(c) :: pc3
end