@@ -179,7 +179,7 @@ std::size_t DynamicType::GetAlignment(
179
179
}
180
180
}
181
181
} else {
182
- return targetCharacteristics.GetAlignment (category_, kind_ );
182
+ return targetCharacteristics.GetAlignment (category_, kind () );
183
183
}
184
184
return 1 ; // needs to be after switch to dodge a bogus gcc warning
185
185
}
@@ -193,14 +193,14 @@ std::optional<Expr<SubscriptInteger>> DynamicType::MeasureSizeInBytes(
193
193
case TypeCategory::Complex:
194
194
case TypeCategory::Logical:
195
195
return Expr<SubscriptInteger>{
196
- context.targetCharacteristics ().GetByteSize (category_, kind_ )};
196
+ context.targetCharacteristics ().GetByteSize (category_, kind () )};
197
197
case TypeCategory::Character:
198
198
if (auto len{charLength ? Expr<SubscriptInteger>{Constant<SubscriptInteger>{
199
199
*charLength}}
200
200
: GetCharLength ()}) {
201
201
return Fold (context,
202
202
Expr<SubscriptInteger>{
203
- context.targetCharacteristics ().GetByteSize (category_, kind_ )} *
203
+ context.targetCharacteristics ().GetByteSize (category_, kind () )} *
204
204
std::move (*len));
205
205
}
206
206
break ;
@@ -540,7 +540,11 @@ static bool AreCompatibleTypes(const DynamicType &x, const DynamicType &y,
540
540
return x.kind () == y.kind () &&
541
541
(ignoreLengths || !xLen || !yLen || *xLen == *yLen);
542
542
} else if (x.category () != TypeCategory::Derived) {
543
- return x.kind () == y.kind ();
543
+ if (x.IsTypelessIntrinsicArgument ()) {
544
+ return y.IsTypelessIntrinsicArgument ();
545
+ } else {
546
+ return !y.IsTypelessIntrinsicArgument () && x.kind () == y.kind ();
547
+ }
544
548
} else {
545
549
const auto *xdt{GetDerivedTypeSpec (x)};
546
550
const auto *ydt{GetDerivedTypeSpec (y)};
@@ -651,7 +655,7 @@ DynamicType DynamicType::ResultTypeForMultiply(const DynamicType &that) const {
651
655
case TypeCategory::Integer:
652
656
switch (that.category_ ) {
653
657
case TypeCategory::Integer:
654
- return DynamicType{TypeCategory::Integer, std::max (kind_ , that.kind_ )};
658
+ return DynamicType{TypeCategory::Integer, std::max (kind () , that.kind () )};
655
659
case TypeCategory::Real:
656
660
case TypeCategory::Complex:
657
661
return that;
@@ -664,9 +668,9 @@ DynamicType DynamicType::ResultTypeForMultiply(const DynamicType &that) const {
664
668
case TypeCategory::Integer:
665
669
return *this ;
666
670
case TypeCategory::Real:
667
- return DynamicType{TypeCategory::Real, std::max (kind_ , that.kind_ )};
671
+ return DynamicType{TypeCategory::Real, std::max (kind () , that.kind () )};
668
672
case TypeCategory::Complex:
669
- return DynamicType{TypeCategory::Complex, std::max (kind_ , that.kind_ )};
673
+ return DynamicType{TypeCategory::Complex, std::max (kind () , that.kind () )};
670
674
default :
671
675
CRASH_NO_CASE;
672
676
}
@@ -677,15 +681,15 @@ DynamicType DynamicType::ResultTypeForMultiply(const DynamicType &that) const {
677
681
return *this ;
678
682
case TypeCategory::Real:
679
683
case TypeCategory::Complex:
680
- return DynamicType{TypeCategory::Complex, std::max (kind_ , that.kind_ )};
684
+ return DynamicType{TypeCategory::Complex, std::max (kind () , that.kind () )};
681
685
default :
682
686
CRASH_NO_CASE;
683
687
}
684
688
break ;
685
689
case TypeCategory::Logical:
686
690
switch (that.category_ ) {
687
691
case TypeCategory::Logical:
688
- return DynamicType{TypeCategory::Logical, std::max (kind_ , that.kind_ )};
692
+ return DynamicType{TypeCategory::Logical, std::max (kind () , that.kind () )};
689
693
default :
690
694
CRASH_NO_CASE;
691
695
}
0 commit comments