Skip to content

Commit

Permalink
Don't warn about missing spaces in C++ lambda capture
Browse files Browse the repository at this point in the history
This should be allowed: [=], [&].
  • Loading branch information
locker committed Sep 2, 2022
1 parent fbd3f84 commit 7bdef04
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7bdef04

Please sign in to comment.