[flang-commits] [PATCH] D126154: [flang] Replace crash and improve a semantics TODO message

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue May 24 14:06:35 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG0a79113b9e06: [flang] Replace crash and improve a semantics TODO message (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126154/new/

https://reviews.llvm.org/D126154

Files:
  flang/lib/Semantics/runtime-type-info.cpp


Index: flang/lib/Semantics/runtime-type-info.cpp
===================================================================
--- flang/lib/Semantics/runtime-type-info.cpp
+++ flang/lib/Semantics/runtime-type-info.cpp
@@ -103,9 +103,13 @@
               lenParameterEnum_, FindLenParameterIndex(*parameters, *lenParam));
         }
       }
+      // TODO: Replace a specification expression requiring actual operations
+      // with a reference to a new anonymous LEN type parameter whose default
+      // value captures the expression.  This replacement must take place when
+      // the type is declared so that the new LEN type parameters appear in
+      // all instantiations and structure constructors.
       context_.Say(location_,
-          "Specification expression '%s' is neither constant nor a length "
-          "type parameter"_err_en_US,
+          "derived type specification expression '%s' that is neither constant nor a length type parameter"_todo_en_US,
           expr->AsFortran());
     }
     return PackageIntValue(deferredEnum_);
@@ -734,7 +738,7 @@
             evaluate::Extremum<evaluate::SubscriptInteger>>(*len)}) {
       if (clamped->ordering == evaluate::Ordering::Greater &&
           clamped->left() == evaluate::Expr<evaluate::SubscriptInteger>{0}) {
-        len = clamped->right();
+        len = common::Clone(clamped->right());
       }
     }
     AddValue(values, componentSchema_, "characterlen"s,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126154.431789.patch
Type: text/x-patch
Size: 1441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220524/058d096c/attachment.bin>


More information about the flang-commits mailing list