2020-05-12 02:38:53 +08:00
|
|
|
! RUN: %S/test_errors.sh %s %t %f18
|
[flang] Semantic checks for C709, C710, and C711
C709 An assumed-type entity shall be a dummy data object that does not
have the ALLOCATABLE, CODIMENSION, INTENT (OUT), POINTER, or VALUE
attribute and is not an explicit-shape array.
C710 An assumed-type variable name shall not appear in a designator or
expression except as an actual argument corresponding to a dummy
argument that is assumed-type, or as the first argument to the intrinsic
function IS_CONTIGUOUS, LBOUND, PRESENT, RANK, SHAPE, SIZE, or UBOUND,
or the function C_LOC from the intrinsic module ISO_C_BINDING.
C711 An assumed-type actual argument that corresponds to an assumed-rank
dummy argument shall be assumed-shape or assumed-rank.
For C709 I added code to check-declarations.cpp. For this, I had to
distinguish between polymorphic types and assumed-type types to
eliminate multiple messages on the same line.
C710 was already checked, but I added a notation in the source.
For C711 I added code to check-call.cpp and the test call15.f90.
Original-commit: flang-compiler/f18@4a703f2b5a6484208a059dc0b456363c138a661d
Reviewed-on: https://github.com/flang-compiler/f18/pull/985
2020-02-15 07:53:11 +08:00
|
|
|
! C709 An assumed-type entity shall be a dummy data object that does not have
|
|
|
|
! the ALLOCATABLE, CODIMENSION, INTENT (OUT), POINTER, or VALUE attribute and
|
|
|
|
! is not an explicit-shape array.
|
|
|
|
subroutine s()
|
|
|
|
!ERROR: Assumed-type entity 'starvar' must be a dummy argument
|
|
|
|
type(*) :: starVar
|
|
|
|
|
|
|
|
contains
|
|
|
|
subroutine inner1(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
|
|
|
|
type(*) :: arg1 ! OK
|
|
|
|
type(*), dimension(*) :: arg2 ! OK
|
|
|
|
!ERROR: Assumed-type argument 'arg3' cannot have the ALLOCATABLE attribute
|
|
|
|
type(*), allocatable :: arg3
|
|
|
|
!ERROR: Assumed-type argument 'arg4' cannot be a coarray
|
|
|
|
type(*), codimension[*] :: arg4
|
|
|
|
!ERROR: Assumed-type argument 'arg5' cannot be INTENT(OUT)
|
|
|
|
type(*), intent(out) :: arg5
|
|
|
|
!ERROR: Assumed-type argument 'arg6' cannot have the POINTER attribute
|
|
|
|
type(*), pointer :: arg6
|
|
|
|
!ERROR: Assumed-type argument 'arg7' cannot have the VALUE attribute
|
|
|
|
type(*), value :: arg7
|
2020-03-06 09:55:51 +08:00
|
|
|
!ERROR: Assumed-type array argument 'arg8' must be assumed shape, assumed size, or assumed rank
|
[flang] Semantic checks for C709, C710, and C711
C709 An assumed-type entity shall be a dummy data object that does not
have the ALLOCATABLE, CODIMENSION, INTENT (OUT), POINTER, or VALUE
attribute and is not an explicit-shape array.
C710 An assumed-type variable name shall not appear in a designator or
expression except as an actual argument corresponding to a dummy
argument that is assumed-type, or as the first argument to the intrinsic
function IS_CONTIGUOUS, LBOUND, PRESENT, RANK, SHAPE, SIZE, or UBOUND,
or the function C_LOC from the intrinsic module ISO_C_BINDING.
C711 An assumed-type actual argument that corresponds to an assumed-rank
dummy argument shall be assumed-shape or assumed-rank.
For C709 I added code to check-declarations.cpp. For this, I had to
distinguish between polymorphic types and assumed-type types to
eliminate multiple messages on the same line.
C710 was already checked, but I added a notation in the source.
For C711 I added code to check-call.cpp and the test call15.f90.
Original-commit: flang-compiler/f18@4a703f2b5a6484208a059dc0b456363c138a661d
Reviewed-on: https://github.com/flang-compiler/f18/pull/985
2020-02-15 07:53:11 +08:00
|
|
|
type(*), dimension(3) :: arg8
|
|
|
|
end subroutine inner1
|
|
|
|
end subroutine s
|