[flang-commits] [flang] 97ca41e - [flang][msvc] Add explicit function template argument to applyLamda. NFC.

Michael Kruse via flang-commits flang-commits at lists.llvm.org
Tue Sep 22 12:22:53 PDT 2020


Author: Michael Kruse
Date: 2020-09-22T14:22:08-05:00
New Revision: 97ca41e1ddfbb6812e2042dcbd2db6e0e7d0bc33

URL: https://github.com/llvm/llvm-project/commit/97ca41e1ddfbb6812e2042dcbd2db6e0e7d0bc33
DIFF: https://github.com/llvm/llvm-project/commit/97ca41e1ddfbb6812e2042dcbd2db6e0e7d0bc33.diff

LOG: [flang][msvc] Add explicit function template argument to applyLamda. NFC.

Like in D87961, msvc has difficulties deducing the template argument. The error message is:
```
expr-parsers.cpp(383): error C2672: 'applyLambda': no matching overloaded function found
```
Explicitly pass the first template argument to help it.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: DavidTruby

Differential Revision: https://reviews.llvm.org/D88001

Added: 
    

Modified: 
    flang/lib/Parser/expr-parsers.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Parser/expr-parsers.cpp b/flang/lib/Parser/expr-parsers.cpp
index 35e68e364ed5..0743e120025b 100644
--- a/flang/lib/Parser/expr-parsers.cpp
+++ b/flang/lib/Parser/expr-parsers.cpp
@@ -379,8 +379,8 @@ template <> std::optional<Expr> Parser<Expr>::Parse(ParseState &state) {
           return Expr{Expr::DefinedBinary(
               std::move(op), std::move(result).value(), std::move(right))};
         }};
-    auto more{
-        attempt(sourced(applyLambda(defBinOp, definedOpName, level5Expr)))};
+    auto more{attempt(
+        sourced(applyLambda<Expr>(defBinOp, definedOpName, level5Expr)))};
     while (std::optional<Expr> next{more.Parse(state)}) {
       result = std::move(next);
       result->source.ExtendToCover(source);


        


More information about the flang-commits mailing list