[flang-commits] [flang] [flang][hlfir] Cast actual cst len character to stmt func dummy type (PR #68598)

Pete Steinfeld via flang-commits flang-commits at lists.llvm.org
Mon Oct 9 09:43:43 PDT 2023


================
@@ -1947,13 +1947,15 @@ void Fortran::lower::mapSymbolAttributes(
   if (ba.isChar()) {
     if (arg) {
       assert(!preAlloc && "dummy cannot be pre-allocated");
-      if (arg.getType().isa<fir::BoxCharType>()) {
+      if (arg.getType().isa<fir::BoxCharType>())
         std::tie(addr, len) = charHelp.createUnboxChar(arg);
-        // Ensure proper type is given to array/scalar that transited via
-        // fir.boxchar arg.
-        mlir::Type castTy = builder.getRefType(converter.genType(var));
-        addr = builder.createConvert(loc, castTy, addr);
-      }
+      else if (!addr)
+        addr = arg;
+      // Ensure proper type is given to array/scalar that transited via
----------------
psteinfeld wrote:

Did you mean "transmitted" rather than "transited"?

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


More information about the flang-commits mailing list