Inquiries into the bounds, size, and length of local variables (and function results)
are acceptable specification expressions. A recent change allowed them for dummy
arguments that are not OPTIONAL or INTENT(OUT), but didn't address other object
entities.
Differential Revision: https://reviews.llvm.org/D125343
// been rewritten into DescriptorInquiry operations.
if (const auto *intrinsic{std::get_if<SpecificIntrinsic>(&call.proc().u)}) {
if (intrinsic->name == "kind" ||
- intrinsic->name == IntrinsicProcTable::InvalidName) {
+ intrinsic->name == IntrinsicProcTable::InvalidName ||
+ call.arguments().empty() || !call.arguments()[0]) {
// kind is always a constant, and we avoid cascading errors by considering
// invalid calls to intrinsics to be constant
return true;
return std::nullopt;
}
}
- return "reference to local entity '"s + ultimate.name().ToString() + "'";
+ if (inInquiry_) {
+ return std::nullopt;
+ } else {
+ return "reference to local entity '"s + ultimate.name().ToString() + "'";
+ }
}
Result operator()(const Component &x) const {