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

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 19:28:44 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd4a1db4f3fd7: [flang][msvc] Workaround 'forgotten' symbols in FoldOperation. NFC. (authored by Meinersbur).

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.295456.patch
Type: text/x-patch
Size: 1148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201001/8abce9df/attachment.bin>


More information about the llvm-commits mailing list