[flang-commits] [flang] [flang][OpenMP]Support for subroutine call for DECLARE REDUCTION init (PR #127889)

Mats Petersson via flang-commits flang-commits at lists.llvm.org
Fri Feb 28 08:19:04 PST 2025


================
@@ -1482,13 +1482,26 @@ class OmpVisitor : public virtual DeclarationVisitor {
     return false;
   }
 
+  bool Pre(const parser::OmpReductionInitializerProc &x) {
+    auto &procDes = std::get<parser::ProcedureDesignator>(x.t);
+    auto &name = std::get<parser::Name>(procDes.u);
+    auto *symbol{FindSymbol(NonDerivedTypeScope(), name)};
+    if (!symbol) {
+      symbol = &MakeSymbol(context().globalScope(), name.source, Attrs{});
+      Resolve(name, *symbol);
+    }
----------------
Leporacanthicus wrote:

Yes, it should be an error. I've added a test, and an error message to say that the subroutine must not be implicitly declared.

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


More information about the flang-commits mailing list