Skip to content

Commit

Permalink
[flang] Allow BOZ initializers on REAL parameters, too.
Browse files Browse the repository at this point in the history
Original-commit: flang-compiler/f18@e1ab6b3
Reviewed-on: flang-compiler/f18#590
Tree-same-pre-rewrite: false
  • Loading branch information
klausler committed Jul 17, 2019
1 parent 8187bc1 commit 3dbc1b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flang/lib/evaluate/tools.cc
Expand Up @@ -535,6 +535,10 @@ std::optional<Expr<SomeType>> ConvertToType(
}
return ConvertToNumeric<TypeCategory::Integer>(type.kind(), std::move(x));
case TypeCategory::Real:
if (auto *boz{std::get_if<BOZLiteralConstant>(&x.u)}) {
return Expr<SomeType>{
ConvertToKind<TypeCategory::Real>(type.kind(), std::move(*boz))};
}
return ConvertToNumeric<TypeCategory::Real>(type.kind(), std::move(x));
case TypeCategory::Complex:
return ConvertToNumeric<TypeCategory::Complex>(type.kind(), std::move(x));
Expand Down

0 comments on commit 3dbc1b7

Please sign in to comment.