[flang-commits] [flang] [flang] Add structure constructor with allocatable component (PR #77845)

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Thu Jan 11 20:14:27 PST 2024


================
@@ -188,6 +188,12 @@ struct IsActuallyConstantHelper {
     return common::visit([this](const auto &y) { return (*this)(y); }, x.u);
   }
   bool operator()(const StructureConstructor &x) {
+    // If the comp-spec of a derived-type-spec is a structure constructor that
----------------
kkwli wrote:

Thanks for the quick review. I was trying to handle the following case. My original approach is not handling it correctly. I will update the patch with the better approach shortly
```fortran
type dt0
  integer, allocatable :: a(:)
end type
type dt1
  type(dt0) :: b
end type
type(dt1) xdt1 = dt1(dt0(5))
```

https://github.com/llvm/llvm-project/pull/77845


More information about the flang-commits mailing list