[flang] Dodge two bogus warnings from g++ 8.1

Original-commit: flang-compiler/f18@aa19aeb92a
Reviewed-on: https://github.com/flang-compiler/f18/pull/633
This commit is contained in:
peter klausler 2019-08-07 09:18:20 -07:00
parent 180ba3354b
commit 58ea24d3e3
2 changed files with 2 additions and 4 deletions

View File

@ -88,9 +88,8 @@ std::optional<DynamicType> ExpressionBase<A>::GetType() const {
[&](const auto &x) -> std::optional<DynamicType> { [&](const auto &x) -> std::optional<DynamicType> {
if constexpr (!common::HasMember<decltype(x), TypelessExpression>) { if constexpr (!common::HasMember<decltype(x), TypelessExpression>) {
return x.GetType(); return x.GetType();
} else {
return std::nullopt;
} }
return std::nullopt; // w/o "else" to dodge bogus g++ 8.1 warning
}, },
derived().u); derived().u);
} }

View File

@ -217,9 +217,8 @@ std::optional<DataRef> ExtractDataRef(const Designator<T> &d) {
[](const auto &x) -> std::optional<DataRef> { [](const auto &x) -> std::optional<DataRef> {
if constexpr (common::HasMember<decltype(x), decltype(DataRef::u)>) { if constexpr (common::HasMember<decltype(x), decltype(DataRef::u)>) {
return DataRef{x}; return DataRef{x};
} else {
return std::nullopt;
} }
return std::nullopt; // w/o "else" to dodge bogus g++ 8.1 warning
}, },
d.u); d.u);
} }