[flang-commits] [flang] [flang] Insert NAMELIST variables into symbol table during Pre (PR #179599)

John Otken via flang-commits flang-commits at lists.llvm.org
Tue Feb 3 20:12:03 PST 2026


================
@@ -7195,6 +7195,10 @@ bool DeclarationVisitor::Pre(const parser::NamelistStmt::Group &x) {
     groupSymbol = &MakeSymbol(groupName, NamelistDetails{});
     groupSymbol->ReplaceName(groupName.source);
   }
+  // insert namelist variables into the symbol table
+  for (const auto &name : std::get<std::list<parser::Name>>(x.t)) {
+    ResolveName(name);
+  }
----------------
jotken wrote:

Yes, FinishNamelists() runs late in the semantic phase so that NAMELIST i followed by REAL i types i to real instead of integer.  I'm not sure of the motivation for this other than the comment about host association (and now the paragraph from Extensions you cited).  I did test host association with this change and it works.  I'm completely fine with -pendantic.  I'm also okay with removing the comment.  I tried to briefly describe what the code does and left out the why.  This reflects a lot of time spent in resolve-names.cpp wondering what a block of code does.  I'm easy so if there are no other comments, I'll make the -pendantic change.  Do you want the comment deleted?  Thanks again for your suggestions.

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


More information about the flang-commits mailing list