Skip to content

Commit 83fe0b1

Browse files
committed
[clang] Fix -Wunused-lambda-capture in TokenAnnotator.cpp (NFC)
llvm-project/clang/lib/Format/TokenAnnotator.cpp:2707:43: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture] auto IsQualifiedPointerOrReference = [this](FormatToken *T) { ^~~~ 1 error generated.
1 parent 5b5c21d commit 83fe0b1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,6 +2707,7 @@ class AnnotatingParser {
27072707
auto IsQualifiedPointerOrReference = [this](FormatToken *T) {
27082708
// This is used to handle cases such as x = (foo *const)&y;
27092709
assert(!T->isTypeName(IsCpp) && "Should have already been checked");
2710+
(void)IsCpp; // Avoid -Wunused-lambda-capture when assertion is disabled.
27102711
// Strip trailing qualifiers such as const or volatile when checking
27112712
// whether the parens could be a cast to a pointer/reference type.
27122713
while (T) {

0 commit comments

Comments
 (0)