[flang][msvc] Explicitly reference "this" inside closure. NFC.
authorMichael Kruse <llvm-project@meinersbur.de>
Tue, 22 Sep 2020 19:20:37 +0000 (14:20 -0500)
committerMichael Kruse <llvm-project@meinersbur.de>
Tue, 22 Sep 2020 19:22:08 +0000 (14:22 -0500)
commit62afc3129dc28638d950c17117347b4e001a613d
tree7a8bb6b8997bce4d1db5c3c853ff184708deac6e
parent97ca41e1ddfbb6812e2042dcbd2db6e0e7d0bc33
[flang][msvc] Explicitly reference "this" inside closure. NFC.

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>.

Reviewed By: DavidTruby

Differential Revision: https://reviews.llvm.org/D88052
flang/lib/Semantics/symbol.cpp