[flang-commits] [flang] [flang] Update PUBLIC and PRIVATE accessibility to Fortran 2018 (PR #177596)

via flang-commits flang-commits at lists.llvm.org
Thu May 21 06:32:54 PDT 2026


================
@@ -9813,6 +9877,35 @@ bool ModuleVisitor::Pre(const parser::AccessStmt &x) {
     for (const auto &accessId : accessIds) {
       GenericSpecInfo info{accessId.v.value()};
       auto *symbol{FindInScope(info.symbolName())};
+      // F2023 8.6.1: a module-name access-id sets default accessibility for
+      // entities USE associated from that module.  The (name, attr) pair was
+      // already recorded by CollectModuleAccessibility(); here we just verify
+      // that it resolves to a module, and skip the per-entity SetAccess path.
+      if (info.kind().IsName()) {
+        const Symbol *moduleSymbol{nullptr};
+        Symbol *resolveSymbol{nullptr};
+        if (!symbol) {
----------------
tmjbios wrote:

F2018:C871 / F2023:C875 is not checked in Flang either main branch or my PR. I'll add the C871 check to this PR.

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


More information about the flang-commits mailing list