mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:26:48 +00:00

As Fortran 2018 C1546, an elemental procedure shall not have the BIND attribute. As 18.3.6, it does not mention that an array with VALUE can be interoperable. It is not reasonable to pass an array by value when the array is too large. Forbid it to be consistent with gfortran/ifort. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D136420
12 lines
326 B
Fortran
12 lines
326 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
! Check for C1546 and 18.3.6
|
|
|
|
! ERROR: 'test1' may not have both the BIND(C) and ELEMENTAL attributes
|
|
elemental subroutine test1() bind(c)
|
|
end
|
|
|
|
subroutine test3(x) bind(c)
|
|
! ERROR: VALUE attribute may not apply to an array in a BIND(C) procedure
|
|
integer, value :: x(100)
|
|
end
|