[flang-commits] [flang] [flang] fix scoping of cray pointer declarations and add check for initialization (PR #136776)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Thu Apr 24 15:15:30 PDT 2025


================
@@ -963,7 +963,17 @@ void CheckHelper::CheckObjectEntity(
         "'%s' is a data object and may not be EXTERNAL"_err_en_US,
         symbol.name());
   }
-
+  if (symbol.test(Symbol::Flag::CrayPointee)) {
+    // NB, IsSaved was too smart here.
+    if (details.init()) {
+      messages_.Say(
+          "Cray pointee '%s' may not be initialized"_err_en_US, symbol.name());
+    } else if (symbol.attrs().test(Attr::SAVE)) {
----------------
klausler wrote:

The `else` here means that at most one message will issue.  Can't both be useful?

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


More information about the flang-commits mailing list