Skip to content

Commit e12c39c

Browse files
committed
rm \n
1 parent 62e4951 commit e12c39c

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

clang-tools-extra/clang-tidy/performance/LostStdMoveCheck.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -89,47 +89,29 @@ void LostStdMoveCheck::registerMatchers(MatchFinder *Finder) {
8989
declRefExpr(
9090
// not "return x;"
9191
unless(ReturnParent),
92-
9392
unless(hasType(namedDecl(hasName("::std::string_view")))),
94-
9593
// non-trivial type
9694
hasType(hasCanonicalType(hasDeclaration(cxxRecordDecl()))),
97-
9895
// non-trivial X(X&&)
9996
unless(hasType(hasCanonicalType(
10097
hasDeclaration(cxxRecordDecl(hasTrivialMoveConstructor()))))),
101-
10298
// Not in a cycle
103-
unless(hasAncestor(forStmt())),
104-
105-
unless(hasAncestor(doStmt())),
106-
99+
unless(hasAncestor(forStmt())), unless(hasAncestor(doStmt())),
107100
unless(hasAncestor(whileStmt())),
108-
109101
// Not in a body of lambda
110102
unless(hasAncestor(compoundStmt(hasAncestor(lambdaExpr())))),
111-
112103
// only non-X&
113104
unless(hasDeclaration(
114105
varDecl(hasType(qualType(lValueReferenceType()))))),
115-
116106
hasAncestor(LeafStatement.bind("leaf_statement")),
117-
118107
hasDeclaration(
119108
varDecl(hasAncestor(functionDecl().bind("func"))).bind("decl")),
120-
121109
anyOf(
122-
123110
// f(x)
124111
hasParent(expr(hasParent(cxxConstructExpr())).bind("use_parent")),
125-
126112
// f((x))
127113
hasParent(parenExpr(hasParent(
128-
expr(hasParent(cxxConstructExpr())).bind("use_parent"))))
129-
130-
)
131-
132-
)
114+
expr(hasParent(cxxConstructExpr())).bind("use_parent"))))))
133115
.bind("use"),
134116
this);
135117
}

0 commit comments

Comments
 (0)