[flang] Make previous commit more precise.

Original-commit: flang-compiler/f18@543da95754
Reviewed-on: https://github.com/flang-compiler/f18/pull/26
Tree-same-pre-rewrite: false
This commit is contained in:
peter klausler 2018-03-15 16:28:37 -07:00
parent 2e5300ce4e
commit 4e02b9e4b0
1 changed files with 4 additions and 1 deletions

View File

@ -436,7 +436,10 @@ public:
if (!std::holds_alternative<DeclarationTypeSpec::Record>(dts.u) &&
std::none_of(decls.begin(), decls.end(),
[](const EntityDecl &d) {
return std::get<std::optional<Initialization>>(d.t).has_value();
const auto &init = std::get<std::optional<Initialization>>(d.t);
return init.has_value() &&
std::holds_alternative<std::list<Indirection<DataStmtValue>>>(
init->u);
}) &&
(!attrs.empty() || !std::holds_alternative<IntrinsicTypeSpec>(dts.u) ||
std::any_of(decls.begin(), decls.end(), [](const EntityDecl &d) {