Good point! Thanks! On Wed, Jan 17, 2024 at 3:34 PM David Blaikie <dblai...@gmail.com> wrote:
> In general, if the lambda is only used within its scope, I'd suggest > switching to a default ref capture "[&]" to reduce maintenance burden of > keeping the capture list up to date. > > On Thu, Jan 11, 2024 at 12:09 PM Kazu Hirata via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > >> >> Author: Kazu Hirata >> Date: 2024-01-11T12:09:01-08:00 >> New Revision: cf3421de587d7c947e8f6b5c754393f85a395747 >> >> URL: >> https://github.com/llvm/llvm-project/commit/cf3421de587d7c947e8f6b5c754393f85a395747 >> DIFF: >> https://github.com/llvm/llvm-project/commit/cf3421de587d7c947e8f6b5c754393f85a395747.diff >> >> LOG: [Format] Fix a warning >> >> This patch fixes: >> >> clang/unittests/Format/TokenAnnotatorTest.cpp:2181:29: error: lambda >> capture 'Style' is not used [-Werror,-Wunused-lambda-capture] >> >> Added: >> >> >> Modified: >> clang/unittests/Format/TokenAnnotatorTest.cpp >> >> Removed: >> >> >> >> >> ################################################################################ >> diff --git a/clang/unittests/Format/TokenAnnotatorTest.cpp >> b/clang/unittests/Format/TokenAnnotatorTest.cpp >> index 33a320f7bb06e6..1ee209444067d6 100644 >> --- a/clang/unittests/Format/TokenAnnotatorTest.cpp >> +++ b/clang/unittests/Format/TokenAnnotatorTest.cpp >> @@ -2178,7 +2178,7 @@ TEST_F(TokenAnnotatorTest, >> UnderstandTableGenTokens) { >> >> TestLexer Lexer(Allocator, Buffers, Style); >> AdditionalKeywords Keywords(Lexer.IdentTable); >> - auto Annotate = [&Lexer, &Style](llvm::StringRef Code) { >> + auto Annotate = [&Lexer](llvm::StringRef Code) { >> return Lexer.annotate(Code); >> }; >> >> >> >> >> _______________________________________________ >> cfe-commits mailing list >> cfe-commits@lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >> >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits