[flang-commits] [flang] [flang][semantics] make sure dynamic type inquiry functions take extensible or unlimited polymorphic types (PR #162931)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Fri Oct 10 17:49:40 PDT 2025


================
@@ -2244,6 +2255,17 @@ std::optional<SpecificCall> IntrinsicInterface::Match(
         return std::nullopt;
       }
       break;
+    case KindCode::ExtensibleOrUnlimitedType:
+      argOk = type->IsUnlimitedPolymorphic() ||
+          (type->category() == TypeCategory::Derived &&
+              IsExtensibleType(GetDerivedTypeSpec(type)));
+      if (!argOk) {
+        messages.Say(arg->sourceLocation(),
+            "Actual argument for '%s=' has bad type '%s', expected extensible derived or unlimited polymorphic type"_err_en_US,
----------------
klausler wrote:

It's a good idea to make sure that the wording of this message doesn't exactly match the wording of the message above, so that you'll only find the one that you want if you have to grep for it.

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


More information about the flang-commits mailing list