Skip to content

Commit a0d3061

Browse files
zwuispetrhosek
authored andcommitted
[Clang-Tidy][NFC] Simplify check cppcoreguidelines-missing-std-forward (llvm#138504)
Remove `CaptureInCopy` because the cases handled by it are covered by `CaptureByRefExplicit`.
1 parent a683f3f commit a0d3061

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

clang-tools-extra/clang-tidy/cppcoreguidelines/MissingStdForwardCheck.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,15 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) {
9292
declRefExpr(to(equalsBoundNode("param"))))));
9393
auto RefToParm = capturesVar(
9494
varDecl(anyOf(hasSameNameAsBoundNode("param"), RefToParmImplicit)));
95-
auto HasRefToParm = hasAnyCapture(RefToParm);
9695

9796
auto CaptureInRef =
9897
allOf(hasCaptureDefaultKind(LambdaCaptureDefault::LCD_ByRef),
9998
unless(hasAnyCapture(
10099
capturesVar(varDecl(hasSameNameAsBoundNode("param"))))));
101-
auto CaptureInCopy = allOf(
102-
hasCaptureDefaultKind(LambdaCaptureDefault::LCD_ByCopy), HasRefToParm);
103100
auto CaptureByRefExplicit = hasAnyCapture(
104101
allOf(hasCaptureKind(LambdaCaptureKind::LCK_ByRef), RefToParm));
105102

106-
auto CapturedInBody =
107-
lambdaExpr(anyOf(CaptureInRef, CaptureInCopy, CaptureByRefExplicit));
103+
auto CapturedInBody = lambdaExpr(anyOf(CaptureInRef, CaptureByRefExplicit));
108104
auto CapturedInCaptureList = hasAnyCapture(capturesVar(
109105
varDecl(hasInitializer(ignoringParenImpCasts(equalsBoundNode("call"))))));
110106

0 commit comments

Comments
 (0)