[flang-commits] [flang] [Flang][Semantics] Allow declare target to be used on functions external to the declare targets scope (PR #122546)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Jan 21 08:26:27 PST 2025


================
@@ -8313,6 +8361,48 @@ const parser::Name *DeclarationVisitor::FindComponent(
   return nullptr;
 }
 
+bool DeclarationVisitor::FindAndMarkDeclareTargetSymbol(
+    const parser::Name &name) {
+  if (!specPartState_.declareTargetNames.empty()) {
+    if (specPartState_.declareTargetNames.count(name.source)) {
+      if (!currScope().IsTopLevel()) {
+        // Search preceding scopes until we find a matching symbol or run out
+        // of scopes to search, we skip the current scope as it's already been
+        // designated as implicit here.
+        Symbol *symbol = nullptr;
----------------
klausler wrote:

This dead declaration has broken several build bots (https://lab.llvm.org/buildbot/#/builders/89/builds/14834).

Please fix or revert.

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


More information about the flang-commits mailing list