[flang-commits] [PATCH] D88504: [flang][msvc] Workaround 'forgotten' symbols FoldOperation. NFC.

Michael Kruse via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Sep 29 15:14:24 PDT 2020


Meinersbur updated this revision to Diff 295132.
Meinersbur added a comment.

- Address @klausler's review


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88504/new/

https://reviews.llvm.org/D88504

Files:
  flang/lib/Evaluate/fold-implementation.h


Index: flang/lib/Evaluate/fold-implementation.h
===================================================================
--- flang/lib/Evaluate/fold-implementation.h
+++ flang/lib/Evaluate/fold-implementation.h
@@ -1155,8 +1155,11 @@
     return *array;
   }
   return std::visit(
-      [&](auto &kindExpr) -> Expr<TO> {
+      [&context, &convert](auto &kindExpr) -> Expr<TO> {
         using Operand = ResultType<decltype(kindExpr)>;
+        // This variable is a workaround for msvc which emits an error when
+        // using the FROMCAT template parameter below.
+        TypeCategory constexpr FromCat{FROMCAT};
         char buffer[64];
         if (auto value{GetScalarConstantValue<Operand>(kindExpr)}) {
           if constexpr (TO::category == TypeCategory::Integer) {
@@ -1213,7 +1216,7 @@
             return Expr<TO>{value->IsTrue()};
           }
         } else if constexpr (std::is_same_v<Operand, TO> &&
-            FROMCAT != TypeCategory::Character) {
+            FromCat != TypeCategory::Character) {
           return std::move(kindExpr); // remove needless conversion
         }
         return Expr<TO>{std::move(convert)};


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88504.295132.patch
Type: text/x-patch
Size: 1148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20200929/08caebdc/attachment.bin>


More information about the flang-commits mailing list