The identifier `Expr` within the scope of the Expr class (including its temple specializations) refers to the current template/instantiation (see https://en.cppreference.com/w/cpp/language/injected-class-name for details). The `MapTemplate` template expect a non-instantiated template as the first template argument, not the concrete instantiation of `Expr`.
At least msvc interprets `Expr` as the injected class name, whereas gcc and clang use the global `flang::evaluate::Expr` template. Disambiguate by explicitly using the namespace.
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 ]].
Reviewed By: DavidTruby
Differential Revision: https://reviews.llvm.org/D85646
using Result = SomeKind<CAT>;
EVALUATE_UNION_CLASS_BOILERPLATE(Expr)
int GetKind() const;
- common::MapTemplate<Expr, CategoryTypes<CAT>> u;
+ common::MapTemplate<evaluate::Expr, CategoryTypes<CAT>> u;
};
template <> class Expr<SomeCharacter> : public ExpressionBase<SomeCharacter> {