[flang][hlfir][NFC] catch dynamically optional args with no lowering These should be lowered with genOptionalValue as in D154897, but I haven't found any cases where this code path is actually hit (flang tests, gfortran test suite), so I don't think it would be testable. Adding an assertion for if this code path ever becomes live. Differential Revision: https://reviews.llvm.org/D155477
diff --git a/flang/lib/Lower/ConvertCall.cpp b/flang/lib/Lower/ConvertCall.cpp index f7d37f7..c1d9d7e 100644 --- a/flang/lib/Lower/ConvertCall.cpp +++ b/flang/lib/Lower/ConvertCall.cpp
@@ -1345,6 +1345,8 @@ } if (!argLowering) { // No argument lowering instruction, lower by value. + assert(!arg.value()->handleDynamicOptional() && + "should use genOptionalValue"); hlfir::Entity actual = arg.value()->getActual(loc, builder); operands.emplace_back( Fortran::lower::convertToValue(loc, converter, actual, stmtCtx));