Files
clang-p2996/flang/test/Semantics/structconst06.f90
Peter Klausler b57bc158ea [flang] Catch obscure structure constructor error
A scalar value in a structure constructor may correspond to an
array component in the derived type only when that component has
a shape to which the scalar value may be expanded.

Differential Revision: https://reviews.llvm.org/D143822
2023-02-13 15:24:35 -08:00

10 lines
265 B
Fortran

! RUN: %python %S/test_errors.py %s %flang_fc1
! Don't expand scalars for allocatable components.
module m
type t
real, allocatable :: a(:)
end type
!ERROR: Scalar value cannot be expanded to shape of array component 'a'
type(t) :: x = t(0.)
end module