Skip to content

Commit 4eda99c

Browse files
committed
Lowering fix after f6ecea1 cherry-pick
evaluate::Parentheses can now be built for derived types, do not except all Parentheses templates to be Type<Cat, Kind> like, it can be SomeDerived.
1 parent 99b8711 commit 4eda99c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

flang/lib/Lower/ConvertExpr.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2658,10 +2658,8 @@ class ScalarArrayExprLowering {
26582658
return fir::factory::ComplexExprHelper{builder, getLoc()}
26592659
.extractComplexPart(fir::getBase(exv), x.isImaginaryPart);
26602660
}
2661-
template <Fortran::common::TypeCategory TC, int KIND>
2662-
ExtValue
2663-
gen(const Fortran::evaluate::Parentheses<Fortran::evaluate::Type<TC, KIND>>
2664-
&x) {
2661+
template <typename T>
2662+
ExtValue gen(const Fortran::evaluate::Parentheses<T> &x) {
26652663
auto exv = gen(x.left());
26662664
auto base = fir::getBase(exv);
26672665
auto newBase =
@@ -4281,10 +4279,8 @@ class ArrayExprLowering {
42814279
lhs, isImagPart);
42824280
};
42834281
}
4284-
template <Fortran::common::TypeCategory TC, int KIND>
4285-
CC genarr(
4286-
const Fortran::evaluate::Parentheses<Fortran::evaluate::Type<TC, KIND>>
4287-
&x) {
4282+
template <typename T>
4283+
CC genarr(const Fortran::evaluate::Parentheses<T> &x) {
42884284
auto loc = getLoc();
42894285
auto f = genarr(x.left());
42904286
return [=](IterSpace iters) -> ExtValue {

0 commit comments

Comments
 (0)