From 97038db10ed46b7b65fbb45cd08ca51f473be7fc Mon Sep 17 00:00:00 2001 From: peter klausler Date: Mon, 4 Mar 2019 17:02:48 -0800 Subject: [PATCH] [flang] Dodge bogus G++ 8.1.0 build warning Original-commit: flang-compiler/f18@582c6d1eca5bc29fddadae4d25e418da4ace2c11 Reviewed-on: https://github.com/flang-compiler/f18/pull/311 Tree-same-pre-rewrite: false --- flang/lib/evaluate/expression.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flang/lib/evaluate/expression.cc b/flang/lib/evaluate/expression.cc index 21bc222..857d876 100644 --- a/flang/lib/evaluate/expression.cc +++ b/flang/lib/evaluate/expression.cc @@ -204,12 +204,11 @@ std::optional ExpressionBase::GetType() const { return std::visit( [](const auto &x) -> std::optional { using Ty = std::decay_t; - if constexpr (std::is_same_v || - std::is_same_v) { - return std::nullopt; // typeless really means "no type" - } else { + if constexpr (!std::is_same_v && + !std::is_same_v) { return x.GetType(); } + return std::nullopt; // typeless really means "no type" }, derived().u); } -- 2.7.4