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

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Mon Jan 15 18:40:52 PST 2024


================
@@ -362,8 +363,18 @@ static mlir::Value genStructureComponentInit(
       loc, fieldTy, name, recTy,
       /*typeParams=*/mlir::ValueRange{} /*TODO*/);
 
-  if (Fortran::semantics::IsAllocatable(sym))
-    TODO(loc, "allocatable component in structure constructor");
+  if (Fortran::semantics::IsAllocatable(sym)) {
+    if (Fortran::evaluate::UnwrapExpr<Fortran::evaluate::NullPointer>(expr)) {
----------------
kkwli wrote:

Thanks for pointing it out. I will update it as you suggest.

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


More information about the flang-commits mailing list