<div dir="ltr">Generally I'd encourage you/anyone to use [&] for any lambda that doesn't escape its scope - avoids any issues like this & doesn't really hinder readability imho.</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 20, 2017 at 9:23 AM Eric Liu via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ioeric<br>
Date: Wed Dec 20 09:22:56 2017<br>
New Revision: 321192<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=321192&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=321192&view=rev</a><br>
Log:<br>
[clangd] Remove an unused lambda capture.<br>
<br>
Modified:<br>
    clang-tools-extra/trunk/unittests/clangd/Annotations.cpp<br>
<br>
Modified: clang-tools-extra/trunk/unittests/clangd/Annotations.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/Annotations.cpp?rev=321192&r1=321191&r2=321192&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/Annotations.cpp?rev=321192&r1=321191&r2=321192&view=diff</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/unittests/clangd/Annotations.cpp (original)<br>
+++ clang-tools-extra/trunk/unittests/clangd/Annotations.cpp Wed Dec 20 09:22:56 2017<br>
@@ -24,7 +24,7 @@ static void require(bool Assertion, cons<br>
<br>
 Annotations::Annotations(StringRef Text) {<br>
   auto Here = [this] { return offsetToPosition(Code, Code.size()); };<br>
-  auto Require = [this, Text](bool Assertion, const char *Msg) {<br>
+  auto Require = [Text](bool Assertion, const char *Msg) {<br>
     require(Assertion, Msg, Text);<br>
   };<br>
   Optional<StringRef> Name;<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>