Peter Klausler c6ec6e3086 [flang] Disallow scalar argument to SIZE/LBOUND/UBOUND
The compiler accepts arguments of any rank, or assumed rank, to a host
of intrinsic inquiry functions.  For scalars, this is correct for most
of them, but the standard (and other compilers) prohibit scalar arguments
to SIZE, LBOUND, and UBOUND (without DIM=).

There are meaningful interpretations for these intrinsic inquiries
on scalars, but since there's no portability concern here, continuing
to support them would be an unjustifiable extension.

Differential Revision: https://reviews.llvm.org/D146587
2023-03-28 04:39:44 -07:00

23 lines
633 B
Fortran

! RUN: %python %S/test_symbols.py %s %flang_fc1
! "Bare" uses of type parameters
!DEF: /MainProgram1/t1 DerivedType
!DEF: /MainProgram1/t1/k TypeParam INTEGER(4)
type :: t1(k)
!REF: /MainProgram1/t1/k
integer, kind :: k=666
!DEF: /MainProgram1/t1/a ObjectEntity REAL(4)
!REF: /MainProgram1/t1/k
real :: a(k)
end type t1
!REF: /MainProgram1/t1
!DEF: /MainProgram1/t2 DerivedType
type, extends(t1) :: t2
!DEF: /MainProgram1/t2/b ObjectEntity REAL(4)
!REF: /MainProgram1/t1/k
real :: b(k)
!REF: /MainProgram1/t1
!DEF: /MainProgram1/t2/x ObjectEntity TYPE(t1(k=666_4))
type(t1) :: x
end type t2
end program