diff --git a/flang/include/flang/Evaluate/traverse.h b/flang/include/flang/Evaluate/traverse.h --- a/flang/include/flang/Evaluate/traverse.h +++ b/flang/include/flang/Evaluate/traverse.h @@ -120,9 +120,27 @@ return visitor_(x.GetFirstSymbol()); } } - template Result operator()(const TypeParamInquiry &x) const { + + // Workaround for compilation with msvc. The compiler has difficulty + // prioritizing templated method imported with the using-declaration in + // derived classes. Therefore, instead of a templated method, declare all + // parameter specializations. + Result operator()(const TypeParamInquiry<1> &x) const { + return visitor_(x.base()); + } + Result operator()(const TypeParamInquiry<2> &x) const { + return visitor_(x.base()); + } + Result operator()(const TypeParamInquiry<4> &x) const { return visitor_(x.base()); } + Result operator()(const TypeParamInquiry<8> &x) const { + return visitor_(x.base()); + } + Result operator()(const TypeParamInquiry<16> &x) const { + return visitor_(x.base()); + } + Result operator()(const Triplet &x) const { return Combine(x.lower(), x.upper(), x.stride()); }