[flang-commits] [flang] [flang][lowering] Implement component-wise initialization for derived types (PR #187465)
via flang-commits
flang-commits at lists.llvm.org
Mon Mar 23 04:16:02 PDT 2026
================
@@ -812,6 +819,244 @@ mustBeDefaultInitializedAtRuntime(const Fortran::lower::pft::Variable &var) {
return Fortran::lower::hasDefaultInitialization(sym);
}
+namespace {
+/// Determines if \p sym represents a complex derived type.
+/// A derived type is considered complex if it contains allocatable, pointer,
+/// or procedure pointer components, or nested complex derived types.
----------------
jeanPerier wrote:
The description is not accurate since this also returns true if there are array components with initial values.
I would avoid the word Complex since it is quite associated with the COMPLEX type in Fortran. `RequiresNonTrivialComponentInitialization` may be a better name.
https://github.com/llvm/llvm-project/pull/187465
More information about the flang-commits
mailing list