From 7bdef049ed8adc4ee874c1ff1b041b781e50f14f Mon Sep 17 00:00:00 2001 From: Vladimir Davydov Date: Fri, 2 Sep 2022 10:59:44 +0300 Subject: [PATCH] Don't warn about missing spaces in C++ lambda capture This should be allowed: [=], [&]. --- checkpatch.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/checkpatch.pl b/checkpatch.pl index 70a3bb4..d64a14a 100755 --- a/checkpatch.pl +++ b/checkpatch.pl @@ -3845,6 +3845,9 @@ sub process { $opline =~ /(\Q$op\E[>,])/ && $-[1] == $off) { # pointer or reference in template arguments + } elsif ($realfile =~ /\.(h|cc)$/ && $op =~ /[=&]/ && $ctx eq 'BxB') { + # lambda capture + } elsif ($realfile =~ /\.(h|cc)$/ && $opline =~ /operator\s*(\Q$op\E)\s*\(/ && $-[1] == $off) { # C++ operator overload