[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
Tue Apr 22 16:15:07 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) ||
+ symbol.implicitAttrs().test(Attr::SAVE)) {
+ messages_.Say(
+ "Cray pointee '%s' may not be SAVE"_err_en_US, symbol.name());
----------------
klausler wrote:
"may not have the SAVE attribute" would be better
https://github.com/llvm/llvm-project/pull/136776
More information about the flang-commits
mailing list