Skip to content

Commit 7bdef04

Browse files
committed
Don't warn about missing spaces in C++ lambda capture
This should be allowed: [=], [&].
1 parent fbd3f84 commit 7bdef04

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

checkpatch.pl

+3
Original file line numberDiff line numberDiff line change
@@ -3845,6 +3845,9 @@ sub process {
38453845
$opline =~ /(\Q$op\E[>,])/ && $-[1] == $off) {
38463846
# pointer or reference in template arguments
38473847

3848+
} elsif ($realfile =~ /\.(h|cc)$/ && $op =~ /[=&]/ && $ctx eq 'BxB') {
3849+
# lambda capture
3850+
38483851
} elsif ($realfile =~ /\.(h|cc)$/ &&
38493852
$opline =~ /operator\s*(\Q$op\E)\s*\(/ && $-[1] == $off) {
38503853
# C++ operator overload

0 commit comments

Comments
 (0)