File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7121,9 +7121,13 @@ void ConstructVisitor::Post(const parser::AssociateStmt &x) {
7121
7121
for (auto nthLastAssoc{assocCount}; nthLastAssoc > 0 ; --nthLastAssoc) {
7122
7122
SetCurrentAssociation (nthLastAssoc);
7123
7123
if (auto *symbol{MakeAssocEntity ()}) {
7124
- if (ExtractCoarrayRef (GetCurrentAssociation ().selector .expr )) { // C1103
7124
+ const MaybeExpr &expr{GetCurrentAssociation ().selector .expr };
7125
+ if (ExtractCoarrayRef (expr)) { // C1103
7125
7126
Say (" Selector must not be a coindexed object" _err_en_US);
7126
7127
}
7128
+ if (evaluate::IsAssumedRank (expr)) {
7129
+ Say (" Selector must not be assumed-rank" _err_en_US);
7130
+ }
7127
7131
SetTypeFromAssociation (*symbol);
7128
7132
SetAttrsFromAssociation (*symbol);
7129
7133
}
Original file line number Diff line number Diff line change
1
+ ! RUN: %python %S/test_errors.py %s %flang_fc1
2
+ subroutine bad (a )
3
+ real :: a(..)
4
+ ! ERROR: Selector must not be assumed-rank
5
+ associate(x = > a)
6
+ end associate
7
+ end subroutine
You can’t perform that action at this time.
0 commit comments