This is an archive of the discontinued LLVM Phabricator instance.

[flang] Allow DATA initialization of derived types w/ allocatable components
ClosedPublic

Authored by klausler on Feb 10 2022, 8:48 AM.

Details

Summary

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.

Diff Detail

Event Timeline

klausler created this revision.Feb 10 2022, 8:48 AM
klausler requested review of this revision.Feb 10 2022, 8:48 AM
mleair accepted this revision.Feb 14 2022, 9:19 AM

Sorry, I thought I approved this already. LGTM.

This revision is now accepted and ready to land.Feb 14 2022, 9:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 10:44 AM