[flang] Simply the test per review comment.

Original-commit: flang-compiler/f18@66ab8bb2aa
Reviewed-on: https://github.com/flang-compiler/f18/pull/351
This commit is contained in:
Eric Schweitz 2019-03-22 15:39:51 -07:00
parent dee4d4be8d
commit 6fce8f1e27
1 changed files with 2 additions and 29 deletions

View File

@ -450,35 +450,8 @@ public:
private:
bool ExpressionHasTypeCategory(const evaluate::GenericExprWrapper &expr,
const common::TypeCategory &type) {
return std::visit(
common::visitors{
[](auto &) { return false; },
[=](const evaluate::Expr<
evaluate::SomeKind<common::TypeCategory::Integer>> &) {
return type == common::TypeCategory::Integer;
},
[=](const evaluate::Expr<
evaluate::SomeKind<common::TypeCategory::Real>> &) {
return type == common::TypeCategory::Real;
},
[=](const evaluate::Expr<
evaluate::SomeKind<common::TypeCategory::Complex>> &) {
return type == common::TypeCategory::Complex;
},
[=](const evaluate::Expr<
evaluate::SomeKind<common::TypeCategory::Character>> &) {
return type == common::TypeCategory::Character;
},
[=](const evaluate::Expr<
evaluate::SomeKind<common::TypeCategory::Logical>> &) {
return type == common::TypeCategory::Logical;
},
[=](const evaluate::Expr<
evaluate::SomeKind<common::TypeCategory::Derived>> &) {
return type == common::TypeCategory::Derived;
},
},
expr.v.u);
auto dynamicType{expr.v.GetType()};
return dynamicType.has_value() && dynamicType->category == type;
}
bool InnermostEnclosingScope(const semantics::Symbol &symbol) const {
// TODO - implement