[clang-tools-extra] r321192 - [clangd] Remove an unused lambda capture.

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 25 10:43:10 PST 2017


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.

On Wed, Dec 20, 2017 at 9:23 AM Eric Liu via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: ioeric
> Date: Wed Dec 20 09:22:56 2017
> New Revision: 321192
>
> URL: http://llvm.org/viewvc/llvm-project?rev=321192&view=rev
> Log:
> [clangd] Remove an unused lambda capture.
>
> Modified:
>     clang-tools-extra/trunk/unittests/clangd/Annotations.cpp
>
> Modified: clang-tools-extra/trunk/unittests/clangd/Annotations.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/Annotations.cpp?rev=321192&r1=321191&r2=321192&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/unittests/clangd/Annotations.cpp (original)
> +++ clang-tools-extra/trunk/unittests/clangd/Annotations.cpp Wed Dec 20
> 09:22:56 2017
> @@ -24,7 +24,7 @@ static void require(bool Assertion, cons
>
>  Annotations::Annotations(StringRef Text) {
>    auto Here = [this] { return offsetToPosition(Code, Code.size()); };
> -  auto Require = [this, Text](bool Assertion, const char *Msg) {
> +  auto Require = [Text](bool Assertion, const char *Msg) {
>      require(Assertion, Msg, Text);
>    };
>    Optional<StringRef> Name;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171225/b3059bbe/attachment.html>


More information about the cfe-commits mailing list