@@ -1579,6 +1579,19 @@ MaybeExpr ExpressionAnalyzer::Analyze(const parser::CoindexedNamedObject &x) {
15791579 std::get<std::list<parser::ImageSelectorSpec>>(x.imageSelector .t )) {
15801580 common::visit (
15811581 common::visitors{
1582+ [&](const parser::ImageSelectorSpec::Notify &x) {
1583+ Analyze (x.v );
1584+ if (const auto *expr{GetExpr (context_, x.v )}) {
1585+ if (coarrayRef.notify ()) {
1586+ Say (" coindexed reference has multiple NOTIFY= specifiers" _err_en_US);
1587+ } else if (auto dyType{expr->GetType ()};
1588+ dyType && IsNotifyType (GetDerivedTypeSpec (*dyType))) {
1589+ coarrayRef.set_notify (Expr<SomeType>{*expr});
1590+ } else {
1591+ Say (" NOTIFY= specifier must have type NOTIFY_TYPE from ISO_FORTRAN_ENV" _err_en_US);
1592+ }
1593+ }
1594+ },
15821595 [&](const parser::ImageSelectorSpec::Stat &x) {
15831596 Analyze (x.v );
15841597 if (const auto *expr{GetExpr (context_, x.v )}) {
@@ -1614,19 +1627,6 @@ MaybeExpr ExpressionAnalyzer::Analyze(const parser::CoindexedNamedObject &x) {
16141627 coarrayRef.set_team (Expr<SomeType>{*expr});
16151628 }
16161629 }
1617- },
1618- [&](const parser::ImageSelectorSpec::Notify &x) {
1619- Analyze (x.v );
1620- if (const auto *expr{GetExpr (context_, x.v )}) {
1621- if (coarrayRef.notify ()) {
1622- Say (" coindexed reference has multiple NOTIFY= specifiers" _err_en_US);
1623- } else if (auto dyType{expr->GetType ()};
1624- dyType && IsNotifyType (GetDerivedTypeSpec (*dyType))) {
1625- coarrayRef.set_notify (Expr<SomeType>{*expr});
1626- } else {
1627- Say (" NOTIFY= specifier must have type NOTIFY_TYPE from ISO_FORTRAN_ENV" _err_en_US);
1628- }
1629- }
16301630 }},
16311631 imageSelSpec.u );
16321632 }
0 commit comments