Peter Klausler 69e2665c8b [flang] BIND(C,NAME=...) corrections
The Fortran standard's various restrictions on the use of BIND(C)
often depend more on the presence or absence of an explicit NAME=
specification rather than on its value, but semantics and module
file generation aren't making distinctions between explicit NAME=
specifications that happen to match the default name and declarations
that don't have NAME=.  Tweak semantics and module file generation
to conform, and also complain when named BIND(C) attributes are
erroneously applied to entities that can't support them, like
ABSTRACT interfaces.

Differential Revision: https://reviews.llvm.org/D145107
2023-03-02 10:10:06 -08:00

14 lines
440 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! Check for C1552
program main
contains
subroutine internal1() bind(c) ! ok
end subroutine
!ERROR: An internal or dummy procedure may not have a BIND(C,NAME=) binding label
subroutine internal2() bind(c,name="internal2")
end subroutine
!ERROR: An internal or dummy procedure may not have a BIND(C,NAME=) binding label
subroutine internal3() bind(c,name="")
end subroutine
end