[flang] Accept NULL() in struct constructor for ALLOCATABLE component

Original-commit: flang-compiler/f18@7aee0e4852
Reviewed-on: https://github.com/flang-compiler/f18/pull/590
Tree-same-pre-rewrite: false
This commit is contained in:
peter klausler 2019-07-18 15:08:50 -07:00
parent 14f693fb94
commit 6da0d748d5
1 changed files with 3 additions and 0 deletions

View File

@ -1357,6 +1357,9 @@ MaybeExpr ExpressionAnalyzer::Analyze(
} else if (MaybeExpr converted{
ConvertToType(*symbol, std::move(*value))}) {
result.Add(*symbol, std::move(*converted));
} else if (IsAllocatable(*symbol) &&
std::holds_alternative<NullPointer>(value->u)) {
// NULL() with no arguments allowed by 7.5.10 para 6 for ALLOCATABLE
} else if (auto symType{DynamicType::From(symbol)}) {
if (valueType.has_value()) {
if (auto *msg{Say(expr.source,