The method `template <int KIND> Result operator()(const TypeParamInquiry<KIND> &)` is defined in `evaluate::GetShapeHelper` as well as in its ancestor `evaluate::Traverse`. Normally, only the overloads of class that first defines method name would be considered, but the declaration `using Base::operator()` imports the base class methods with the same signature. Msvc interprets this as an ambiguity. [[ https://en.cppreference.com/w/cpp/language/using_declaration | According to cppreference.com ]], derived class members hide members imported with the using directive. Hence this is probably a bug in msvc not implementing this rule for templated methods.
This pattern occurs in the following classes:
Fix by moving the generic TypeParamInquiry operator() overload into the derived classes that do not define this overload themselves.
This patch is part of the series to [[ http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html | make flang compilable with MS Visual Studio ]].