forked from OSchip/llvm-project
[flang] Dodge bogus G++ 8.1.0 build warning
Original-commit: flang-compiler/f18@582c6d1eca Reviewed-on: https://github.com/flang-compiler/f18/pull/311 Tree-same-pre-rewrite: false
This commit is contained in:
parent
da2ebb6063
commit
97038db10e
|
@ -204,12 +204,11 @@ std::optional<DynamicType> ExpressionBase<A>::GetType() const {
|
|||
return std::visit(
|
||||
[](const auto &x) -> std::optional<DynamicType> {
|
||||
using Ty = std::decay_t<decltype(x)>;
|
||||
if constexpr (std::is_same_v<Ty, BOZLiteralConstant> ||
|
||||
std::is_same_v<Ty, NullPointer>) {
|
||||
return std::nullopt; // typeless really means "no type"
|
||||
} else {
|
||||
if constexpr (!std::is_same_v<Ty, BOZLiteralConstant> &&
|
||||
!std::is_same_v<Ty, NullPointer>) {
|
||||
return x.GetType();
|
||||
}
|
||||
return std::nullopt; // typeless really means "no type"
|
||||
},
|
||||
derived().u);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue