Skip to content

Commit 47acfec

Browse files
[Flang] Add check for CharacterType for ArrayConstructor
1 parent 0b5e7a8 commit 47acfec

File tree

1 file changed

+5
-1
lines changed
  • flang/include/flang/Lower/Support

1 file changed

+5
-1
lines changed

flang/include/flang/Lower/Support/Utils.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,11 @@ class IsEqualEvaluateExpr {
575575
template <typename A>
576576
static bool isEqual(const Fortran::evaluate::ArrayConstructor<A> &x,
577577
const Fortran::evaluate::ArrayConstructor<A> &y) {
578-
return isEqual(x, y) && x.GetType() == y.GetType();
578+
bool checkCharacterType = true;
579+
if constexpr (A::category == Fortran::common::TypeCategory::Character) {
580+
checkCharacterType = x.LEN() == y.LEN();
581+
}
582+
return isEqual(x, y) && x.GetType() == y.GetType() && checkCharacterType;
579583
}
580584
static bool isEqual(const Fortran::evaluate::ImpliedDoIndex &x,
581585
const Fortran::evaluate::ImpliedDoIndex &y) {

0 commit comments

Comments
 (0)