From 70b05522b0a751d4b60db0627bd20d0a92f39886 Mon Sep 17 00:00:00 2001 From: peter klausler Date: Tue, 2 Apr 2019 11:02:30 -0700 Subject: [PATCH] [flang] Also fix bug#377 Original-commit: flang-compiler/f18@56631cf5e10a5f7f2909d8b83ede72b21d986348 Reviewed-on: https://github.com/flang-compiler/f18/pull/378 Tree-same-pre-rewrite: false --- flang/lib/evaluate/formatting.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/flang/lib/evaluate/formatting.cc b/flang/lib/evaluate/formatting.cc index a44a075..e5ebc2a 100644 --- a/flang/lib/evaluate/formatting.cc +++ b/flang/lib/evaluate/formatting.cc @@ -212,14 +212,14 @@ static constexpr Precedence GetPrecedence(const Expr &expr) { [](const auto &x) { return ToPrecedence>; }, expr.u); } +static constexpr Precedence GetPrecedence(const BOZLiteralConstant &) { + return Precedence::Primary; +} +static constexpr Precedence GetPrecedence(const NullPointer &) { + return Precedence::Primary; +} static constexpr Precedence GetPrecedence(const Expr &expr) { - return std::visit( - common::visitors{ - [](const BOZLiteralConstant &) { return Precedence::Primary; }, - [](const NullPointer &) { return Precedence::Primary; }, - [](const auto &x) { return GetPrecedence(x); }, - }, - expr.u); + return std::visit([](const auto &x) { return GetPrecedence(x); }, expr.u); } template static bool IsNegatedScalarConstant(const Expr &expr) { -- 2.7.4