[flang] Resolve old TODO about needless Indirection<>.

Original-commit: flang-compiler/f18@5f289209c4
Reviewed-on: https://github.com/flang-compiler/f18/pull/73
Tree-same-pre-rewrite: false
This commit is contained in:
peter klausler 2018-04-24 15:25:11 -07:00
parent 0ceb4abf1a
commit 69e3842d60
2 changed files with 6 additions and 7 deletions

View file

@ -853,9 +853,9 @@ TYPE_CONTEXT_PARSER("array constructor"_en_US,
"(/" >> Parser<AcSpec>{} / "/)" || bracketed(Parser<AcSpec>{})))
// R770 ac-spec -> type-spec :: | [type-spec ::] ac-value-list
TYPE_PARSER(construct<AcSpec>(maybe(indirect(typeSpec) / "::"),
nonemptyList(Parser<AcValue>{})) ||
construct<AcSpec>(indirect(typeSpec) / "::"))
TYPE_PARSER(construct<AcSpec>(
maybe(typeSpec / "::"), nonemptyList(Parser<AcValue>{})) ||
construct<AcSpec>(typeSpec / "::"))
// R773 ac-value -> expr | ac-implied-do
TYPE_PARSER(

View file

@ -1155,11 +1155,10 @@ struct AcValue {
// R770 ac-spec -> type-spec :: | [type-spec ::] ac-value-list
struct AcSpec {
BOILERPLATE(AcSpec);
AcSpec(std::optional<Indirection<TypeSpec>> &&ts, std::list<AcValue> &&xs)
AcSpec(std::optional<TypeSpec> &&ts, std::list<AcValue> &&xs)
: type(std::move(ts)), values(std::move(xs)) {}
explicit AcSpec(Indirection<TypeSpec> &&ts) : type{std::move(ts)} {}
// TODO need Indirection here to compile, don't know why
std::optional<Indirection<TypeSpec>> type;
explicit AcSpec(TypeSpec &&ts) : type{std::move(ts)} {}
std::optional<TypeSpec> type;
std::list<AcValue> values;
};