[flang-commits] [flang] [flang] fix private pointers and default initialized variables (PR #118494)

via flang-commits flang-commits at lists.llvm.org
Wed Dec 4 07:06:56 PST 2024


================
@@ -768,13 +768,21 @@ class FirConverter : public Fortran::lower::AbstractConverter {
     // Initialise cloned allocatable
     hexv.match(
         [&](const fir::MutableBoxValue &box) -> void {
-          // Do not process pointers
+          const auto new_box = exv.getBoxOf<fir::MutableBoxValue>();
           if (Fortran::semantics::IsPointer(sym.GetUltimate())) {
+            // Establish the pointer descriptors. The rank and type code/size
+            // at least must be set properly for later inquiry of the pointer
+            // to work, and new pointers are always given diassociated status
----------------
jeanPerier wrote:

```suggestion
            // to work, and new pointers are always given disassociated status
```

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


More information about the flang-commits mailing list