[flang][hlfir] Use actual type when copying an actual argument variable
The copy must made according to the actual type, not the dummy type. In case the dummy is polymorphic, these types will be different and the dynamic type of the copy passed in the call should be the one of the actual. There is no support for "class(t), value" yet (it is hitting a TODO in CallInterface that is moot for HLFIR but has not been lifted for lack of proper testing) so the bug was dormant, but D151271 created a situation where a copy is needed with polymorphic dummies and exposed the bug. This led to a compile time assert "value.isScalar() && fir::isa_trivial(value.getType())" in "hlfir::genAssociateExpr". Differential Revision: https://reviews.llvm.org/D151413
parent
29122340
Please register or sign in to comment