Page MenuHomePhabricator

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

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



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

Diff Detail