This is an archive of the discontinued LLVM Phabricator instance.

[flang][msvc] Fix lambda capture ambiguity. NFC.
ClosedPublic

Authored by Meinersbur on Oct 13 2020, 11:43 PM.

Details

Summary

Patch D88695 introduces a new local variable inside a lambda with the same name as a variable outside of it. In some of the if constexpr regions, msvc prioritizes the outer declaration and emits the error.

C:\Users\meinersbur\src\llvm-project\flang\lib\Evaluate\fold-implementation.h(1200): error C3493: 'context' cannot be implicitly captured because no default capture mode has been specified

This is fixed by giving the inner variable a different name.

Diff Detail

Event Timeline

Meinersbur created this revision.Oct 13 2020, 11:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2020, 11:43 PM
Meinersbur requested review of this revision.Oct 13 2020, 11:43 PM
klausler accepted this revision.Oct 21 2020, 9:59 AM
This revision is now accepted and ready to land.Oct 21 2020, 9:59 AM
This revision was automatically updated to reflect the committed changes.