[flang-commits] [PATCH] D143826: [flang] Respect inaccessibility of type-bound ASSIGNMENT(=)

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Feb 13 15:58:44 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG632fd9fb861c: [flang] Respect inaccessibility of type-bound ASSIGNMENT(=) (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143826/new/

https://reviews.llvm.org/D143826

Files:
  flang/lib/Semantics/expression.cpp


Index: flang/lib/Semantics/expression.cpp
===================================================================
--- flang/lib/Semantics/expression.cpp
+++ flang/lib/Semantics/expression.cpp
@@ -4038,18 +4038,16 @@
     auto restorer{context_.GetContextualMessages().DiscardMessages()};
     if (const Symbol *symbol{scope.FindSymbol(oprName)}) {
       ExpressionAnalyzer::AdjustActuals noAdjustment;
-      auto pair{context_.ResolveGeneric(*symbol, actuals_, noAdjustment, true)};
-      if (pair.first) {
-        proc = pair.first;
-      } else {
-        context_.EmitGenericResolutionError(*symbol, pair.second, true);
-      }
+      proc =
+          context_.ResolveGeneric(*symbol, actuals_, noAdjustment, true).first;
     }
     for (std::size_t i{0}; !proc && i < actuals_.size(); ++i) {
       const Symbol *generic{nullptr};
       if (const Symbol *binding{FindBoundOp(oprName, i, generic, true)}) {
-        if (const Symbol *resolution{
-                GetBindingResolution(GetType(i), *binding)}) {
+        if (CheckAccessibleSymbol(scope, DEREF(generic))) {
+          // ignore inaccessible type-bound ASSIGNMENT(=) generic
+        } else if (const Symbol *
+            resolution{GetBindingResolution(GetType(i), *binding)}) {
           proc = resolution;
         } else {
           proc = binding;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143826.497139.patch
Type: text/x-patch
Size: 1327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230213/e87ec043/attachment-0001.bin>


More information about the flang-commits mailing list