https://bugs.llvm.org/show_bug.cgi?id=34865

Richard Smith <richard-l...@metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #4 from Richard Smith <richard-l...@metafoo.co.uk> ---
Reopening: while the warning may be correct, the location if the diagnostic is
not quite right. We should instead be pointing at the point of use:

test2.cpp:4:29: warning: lambda capture 'varRef' is not required to be captured
for this use [-Wunused-lambda-capture]
    return [&varRef]{return varRef;}();
                            ^

... and it'd be a good idea to add a note, something like:

test2.cpp:3:29: note: 'varRef' is a reference bound to a constant expression
evaluating to 'var'; that lvalue will be used in place of 'varRef' in the
lambda body
    int& varRef = var;
         ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to