[all-commits] [llvm/llvm-project] 0b671a: [flang][msvc] Fix lambda capture ambiguity. NFC.

Michael Kruse via All-commits all-commits at lists.llvm.org
Fri Oct 23 20:59:00 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 0b671a44ad2d606647aa14d5782425b39aed9271
      https://github.com/llvm/llvm-project/commit/0b671a44ad2d606647aa14d5782425b39aed9271
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

  Changed paths:
    M flang/lib/Evaluate/fold-implementation.h

  Log Message:
  -----------
  [flang][msvc] Fix lambda capture ambiguity. NFC.

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.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D89367




More information about the All-commits mailing list