This is an archive of the discontinued LLVM Phabricator instance.

[flang][msvc] Explicitly reference "this" inside closure. NFC.
ClosedPublic

Authored by Meinersbur on Sep 21 2020, 3:40 PM.

Details

Summary

The Microsoft compiler seems to have difficulties to decide between a const/non-const method of a captured object context in a closure. The error message is:

symbol.cpp(261): error C2668: 'Fortran::semantics::Symbol::detailsIf': ambiguous call to overloaded function
symbol.h(535): note: could be 'const D *Fortran::semantics::Symbol::detailsIf<Fortran::semantics::DerivedTypeDetails>(void) const'
symbol.h(534): note: or       'D *Fortran::semantics::Symbol::detailsIf<Fortran::semantics::DerivedTypeDetails>(void)'
symbol.cpp(261): note: while trying to match the argument list '()'

Explicitly using the this-pointer resolves this problem.

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.

Diff Detail

Event Timeline

Meinersbur created this revision.Sep 21 2020, 3:40 PM
Herald added a project: Restricted Project. · View Herald Transcript
Meinersbur requested review of this revision.Sep 21 2020, 3:40 PM
This revision is now accepted and ready to land.Sep 22 2020, 6:11 AM
This revision was landed with ongoing or failed builds.Sep 22 2020, 12:23 PM
This revision was automatically updated to reflect the committed changes.