Skip to content

Commit c43dbb6

Browse files
committed
[Flang] Cast the init target to the decl type of procedure pointer.
1 parent 0ca6824 commit c43dbb6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flang/lib/Lower/ConvertVariable.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,8 @@ static fir::GlobalOp defineGlobal(Fortran::lower::AbstractConverter &converter,
565565
/*cleanupProhibited=*/true);
566566
auto box{Fortran::lower::convertProcedureDesignatorInitialTarget(
567567
converter, loc, *sym)};
568-
b.create<fir::HasValueOp>(loc, box);
568+
auto castTo{builder.createConvert(loc, symTy, box)};
569+
b.create<fir::HasValueOp>(loc, castTo);
569570
});
570571
else { // Has NULL() target.
571572
Fortran::lower::createGlobalInitialization(

0 commit comments

Comments
 (0)