[flang-commits] [flang] [Flang] Handle self-referencing KIND selectors (PR #216668)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Wed Aug 19 14:53:06 PDT 2026


================
@@ -10580,6 +10580,26 @@ void ResolveNamesVisitor::PreSpecificationConstruct(
       spec.u);
 }
 
+static bool IsCallOfDeclaredEntity(
+    const parser::Call &call, const std::list<parser::EntityDecl> &entities) {
+  // Pure query: do not resolve names or modify symbols/scopes.
+  const auto &procDesignator{std::get<parser::ProcedureDesignator>(call.t)};
+
+  const auto *name{std::get_if<parser::Name>(&procDesignator.u)};
----------------
eugeneepshteyn wrote:

Sometimes it's worth having an early return, but here I think it would be better to restructure this: `if (const auto *name{std::get_if<parser::Name>(&procDesignator.u)}) {` then move the `for` block to inside of this `if` block. Then there's one catch-all `return false` at the end.

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


More information about the flang-commits mailing list