[flang-commits] [PATCH] D132594: [flang] Fix msvc 17.3 build.

Michael Kruse via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Aug 24 14:48:44 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG71d80cd6ed77: [flang] Fix msvc 17.3 build. (authored by Meinersbur).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132594

Files:
  flang/lib/Evaluate/fold-integer.cpp


Index: flang/lib/Evaluate/fold-integer.cpp
===================================================================
--- flang/lib/Evaluate/fold-integer.cpp
+++ flang/lib/Evaluate/fold-integer.cpp
@@ -798,7 +798,10 @@
                   "missing case to fold intrinsic function %s", name.c_str());
             }
             return FoldElementalIntrinsic<T, TI>(context, std::move(funcRef),
-                ScalarFunc<T, TI>([&fptr](const Scalar<TI> &i) -> Scalar<T> {
+                // `i` should be declared as `const Scalar<TI>&`.
+                // We declare it as `auto` to workaround an msvc bug:
+                // https://developercommunity.visualstudio.com/t/Regression:-nested-closure-assumes-wrong/10130223
+                ScalarFunc<T, TI>([&fptr](const auto &i) -> Scalar<T> {
                   return Scalar<T>{std::invoke(fptr, i)};
                 }));
           },


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132594.455387.patch
Type: text/x-patch
Size: 887 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220824/5c1badc7/attachment.bin>


More information about the flang-commits mailing list