Files
Peter Klausler 05a3f76dca [flang] Process legacy DATA-style /initializers/ sooner (#162722)
The compiler can't defer the conversion of legacy DATA-style
/initializers/ in component declarations to their init() expressions to
the general DATA statement conversion pass, since default component
values must be present during structure constructor analysis. So move
their conversions into name resolution and handle them at the same times
as standard '=' initializers are processed. Avoid any potential problems
with type parameters being used as repetition counts or values by
disallowing legacy DATA-style initializers in PDTs.

Fixes https://github.com/llvm/llvm-project/issues/161989.
2025-10-10 10:09:56 -07:00

8 lines
229 B
Fortran

! RUN: %flang_fc1 -fdebug-dump-symbols %s 2>&1 | FileCheck %s
! Ensure that DATA-like default component initializers work.
! CHECK: j size=4 offset=0: ObjectEntity type: INTEGER(4) init:123_4
type t
integer j/123/
end type
end