Skip to content

Commit

Permalink
[clang] Fix -Wunused-lambda-capture in TokenAnnotator.cpp (NFC)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DamonFool committed Mar 9, 2024
1 parent 5b5c21d commit 83fe0b1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions clang/lib/Format/TokenAnnotator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2707,6 +2707,7 @@ class AnnotatingParser {
auto IsQualifiedPointerOrReference = [this](FormatToken *T) {
// This is used to handle cases such as x = (foo *const)&y;
assert(!T->isTypeName(IsCpp) && "Should have already been checked");
(void)IsCpp; // Avoid -Wunused-lambda-capture when assertion is disabled.
// Strip trailing qualifiers such as const or volatile when checking
// whether the parens could be a cast to a pointer/reference type.
while (T) {
Expand Down

0 comments on commit 83fe0b1

Please sign in to comment.