[flang-commits] [PATCH] D119449: [flang] Allow DATA initialization of derived types w/ allocatable components

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Feb 10 08:48:10 PST 2022


klausler created this revision.
klausler added a reviewer: mleair.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.

While one cannot of course statically initialize an allocatable component
of an instance of a derived type, its mere presence should not prevent
DATA initialization of the other nonallocatable components.  Semantics
was treating the existence of an allocatable component as a case of
"default initialization", which it is, but not one that should run
afoul of C877.  Add another Boolean argument to IsInitialized() to allow
for a more nuanced test.


https://reviews.llvm.org/D119449

Files:
  flang/include/flang/Semantics/tools.h
  flang/include/flang/Semantics/type.h
  flang/lib/Evaluate/initial-image.cpp
  flang/lib/Semantics/check-data.cpp
  flang/lib/Semantics/tools.cpp
  flang/lib/Semantics/type.cpp
  flang/test/Semantics/data04.f90
  flang/test/Semantics/data06.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119449.407556.patch
Type: text/x-patch
Size: 7320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220210/fbe52239/attachment-0001.bin>


More information about the flang-commits mailing list