[flang-commits] [flang] 2bc589b - [flang][msvc] Add explicit function template argument to applyFunction. NFC.

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


Author: Michael Kruse
Date: 2020-09-22T14:22:08-05:00
New Revision: 2bc589bbb8d7d00f5939e9cd33cbe57e47d61f7e

URL: https://github.com/llvm/llvm-project/commit/2bc589bbb8d7d00f5939e9cd33cbe57e47d61f7e
DIFF: https://github.com/llvm/llvm-project/commit/2bc589bbb8d7d00f5939e9cd33cbe57e47d61f7e.diff

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

Msvc has difficulties deducing the template argument here. The error message is:
```
basic-parsers.h(790,12): error C2672: 'applyFunction': 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/D87961

Added: 
    

Modified: 
    flang/lib/Parser/basic-parsers.h

Removed: 
    


################################################################################
diff  --git a/flang/lib/Parser/basic-parsers.h b/flang/lib/Parser/basic-parsers.h
index c92ece0ef677..7f349d7b4ff4 100644
--- a/flang/lib/Parser/basic-parsers.h
+++ b/flang/lib/Parser/basic-parsers.h
@@ -787,7 +787,8 @@ template <typename PA, typename PB> class NonemptySeparated {
   constexpr NonemptySeparated(const NonemptySeparated &) = default;
   constexpr NonemptySeparated(PA p, PB sep) : parser_{p}, separator_{sep} {}
   std::optional<resultType> Parse(ParseState &state) const {
-    return applyFunction(prepend<paType>, parser_, many(separator_ >> parser_))
+    return applyFunction<std::list<paType>>(
+        prepend<paType>, parser_, many(separator_ >> parser_))
         .Parse(state);
   }
 


        


More information about the flang-commits mailing list