[LLVMbugs] [Bug 21110] Warn on possibly unintended non-shadowing in lambda init-capture

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 31 08:37:05 PDT 2014


jonathan.sauer at gmx.de changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
                 CC|                            |jonathan.sauer at gmx.de
          Component|C++                         |C++1y
         Resolution|DUPLICATE                   |---
            Summary|Stop -Wshadow from catching |Warn on possibly unintended
                   |obviously intended          |non-shadowing in lambda
                   |shadowing                   |init-capture

--- Comment #2 from jonathan.sauer at gmx.de ---
(In reply to comment #1)
This part doesn't seem to be covered by bug 16088, though:

>Of course there are times when the a lambda's captures' shadowing might be >problematic and a warning could be appropriate:
>    int i, j;
>    [&i = j] { // use i...? }

Here clang could generate a warning that the init-capture "i" is initialized
with local variable "j" when most likely be local variable "i" should be used.
I.e. warn because the init-capture "i" *does not* shadow local variable "i".

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141031/27c56f17/attachment.html>

More information about the llvm-bugs mailing list