Page MenuHomePhabricator

[flang][msvc] Disambiguate injected class name.
ClosedPublic

Authored by Meinersbur on Aug 10 2020, 6:11 AM.

Details

Summary

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 make flang compilable with MS Visual Studio.

Diff Detail

Event Timeline

Meinersbur created this revision.Aug 10 2020, 6:11 AM
Herald added a project: Restricted Project. · View Herald Transcript
Meinersbur requested review of this revision.Aug 10 2020, 6:11 AM
Meinersbur edited the summary of this revision. (Show Details)
Meinersbur edited the summary of this revision. (Show Details)Aug 10 2020, 6:18 AM
Meinersbur edited the summary of this revision. (Show Details)Aug 12 2020, 2:58 PM
DavidTruby accepted this revision.Aug 14 2020, 5:49 AM

LGTM!

Interesting that the compilers don't use the same lookup rule here. I wonder which is correct (my gut feeling is actually that MSVC is).

This revision is now accepted and ready to land.Aug 14 2020, 5:49 AM
This revision was automatically updated to reflect the committed changes.