[flang-commits] [flang] [flang][Semantics] Enforce F2023 C1545 only for generic references (PR #219581)

Caroline Newcombe via flang-commits flang-commits at lists.llvm.org
Wed Sep 30 11:46:36 PDT 2026


================
@@ -3454,12 +3479,15 @@ auto ExpressionAnalyzer::GetCalleeAndArguments(const parser::Name &name,
   bool isExplicitIntrinsic{ultimate.attrs().test(semantics::Attr::INTRINSIC)};
   const Symbol *resolution{nullptr};
   SymbolVector tried;
+  bool errorReported{false};
   if (isGenericInterface || isExplicitIntrinsic) {
     ExpressionAnalyzer::AdjustActuals noAdjustment;
-    auto result{ResolveGeneric(*symbol, arguments, noAdjustment, isSubroutine,
-        SymbolVector{}, mightBeStructureConstructor)};
+    auto result{
+        CheckAndResolveGenericReference(*symbol, arguments, noAdjustment,
+            isSubroutine, SymbolVector{}, mightBeStructureConstructor)};
     resolution = result.specific;
     dueToAmbiguity = result.failedDueToAmbiguity;
+    errorReported = result.errorReported;
----------------
cenewcombe wrote:

`errorReported` doesn't actually stop resolution here — it only suppresses `EmitGenericResolutionError` further down, and that call is already gated on `isGenericInterface`. Should we bail here to avoid an unexpected resolution pathway for intrinsics?
```
    errorReported = result.errorReported;
    tried = std::move(result.tried);
    if (errorReported) {
      return std::nullopt;
    }
```

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


More information about the flang-commits mailing list