This resolves an issue where the Microsoft compiler 'forgets' symbols when using constexpr in a lambda in a templated function. The symbols are:
- The implicit lambda captures context and convert. Fix by making them explicit captures. The error message was:
fold-implementation.h(1220): error C2065: 'convert': undeclared identifier
- The function template argument FROMCAT. Fix by storing it in a temporary constexpr variable inside the function. The error message was:
fold-implementation.h(1216): error C2065: 'FROMCAT': undeclared identifier
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.
Please conform to our conventional use of braced initialization, and consider adding a comment that the new constexpr is a MSVC work-around, or it'll be susceptible to being removed as redundant.