forked from OSchip/llvm-project
[flang] Accept SIZE(assumed-rank, DIM=n)
Silence a bogus error message about an out-of-range DIM= argument when the argument is assumed-rank. (More generally, don't pretend to be able to discern a shape of known rank for an assumed-rank object.) Differential Revision: https://reviews.llvm.org/D109915
This commit is contained in:
parent
41ff7612b3
commit
12ba727897
|
@ -500,6 +500,8 @@ auto GetShapeHelper::operator()(const Symbol &symbol) const -> Result {
|
|||
[&](const semantics::ObjectEntityDetails &object) {
|
||||
if (IsImpliedShape(symbol) && object.init()) {
|
||||
return (*this)(object.init());
|
||||
} else if (IsAssumedRank(symbol)) {
|
||||
return Result{};
|
||||
} else {
|
||||
int n{object.shape().Rank()};
|
||||
NamedEntity base{symbol};
|
||||
|
@ -517,12 +519,12 @@ auto GetShapeHelper::operator()(const Symbol &symbol) const -> Result {
|
|||
}
|
||||
},
|
||||
[&](const semantics::AssocEntityDetails &assoc) {
|
||||
if (!assoc.rank()) {
|
||||
return (*this)(assoc.expr());
|
||||
} else {
|
||||
if (assoc.rank()) { // SELECT RANK case
|
||||
int n{assoc.rank().value()};
|
||||
NamedEntity base{symbol};
|
||||
return Result{CreateShape(n, base)};
|
||||
} else {
|
||||
return (*this)(assoc.expr());
|
||||
}
|
||||
},
|
||||
[&](const semantics::SubprogramDetails &subp) {
|
||||
|
|
Loading…
Reference in New Issue