[Flang][Runtime] Fix implicit conversion warning when targeting 32bit… (#99465)
… architecture
On 32 bit systems, TypeParameterValue is 64bit wide while CFI_index_t is
32bit wide.
diff --git a/flang/runtime/derived.cpp b/flang/runtime/derived.cpp
index 0d9e033..659f54f 100644
--- a/flang/runtime/derived.cpp
+++ b/flang/runtime/derived.cpp
@@ -23,10 +23,9 @@
const typeInfo::Component &comp, const Descriptor &derivedInstance) {
const typeInfo::Value *bounds{comp.bounds()};
for (int dim{0}; dim < comp.rank(); ++dim) {
- SubscriptValue lb{bounds[2 * dim].GetValue(&derivedInstance).value_or(0)};
- SubscriptValue ub{
- bounds[2 * dim + 1].GetValue(&derivedInstance).value_or(0)};
- extents[dim] = ub >= lb ? ub - lb + 1 : 0;
+ auto lb{bounds[2 * dim].GetValue(&derivedInstance).value_or(0)};
+ auto ub{bounds[2 * dim + 1].GetValue(&derivedInstance).value_or(0)};
+ extents[dim] = ub >= lb ? static_cast<SubscriptValue>(ub - lb + 1) : 0;
}
}