File tree Expand file tree Collapse file tree 1 file changed +2
-20
lines changed Expand file tree Collapse file tree 1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -89,47 +89,29 @@ void LostStdMoveCheck::registerMatchers(MatchFinder *Finder) {
89
89
declRefExpr (
90
90
// not "return x;"
91
91
unless (ReturnParent),
92
-
93
92
unless (hasType (namedDecl (hasName (" ::std::string_view" )))),
94
-
95
93
// non-trivial type
96
94
hasType (hasCanonicalType (hasDeclaration (cxxRecordDecl ()))),
97
-
98
95
// non-trivial X(X&&)
99
96
unless (hasType (hasCanonicalType (
100
97
hasDeclaration (cxxRecordDecl (hasTrivialMoveConstructor ()))))),
101
-
102
98
// Not in a cycle
103
- unless (hasAncestor (forStmt ())),
104
-
105
- unless (hasAncestor (doStmt ())),
106
-
99
+ unless (hasAncestor (forStmt ())), unless (hasAncestor (doStmt ())),
107
100
unless (hasAncestor (whileStmt ())),
108
-
109
101
// Not in a body of lambda
110
102
unless (hasAncestor (compoundStmt (hasAncestor (lambdaExpr ())))),
111
-
112
103
// only non-X&
113
104
unless (hasDeclaration (
114
105
varDecl (hasType (qualType (lValueReferenceType ()))))),
115
-
116
106
hasAncestor (LeafStatement.bind (" leaf_statement" )),
117
-
118
107
hasDeclaration (
119
108
varDecl (hasAncestor (functionDecl ().bind (" func" ))).bind (" decl" )),
120
-
121
109
anyOf (
122
-
123
110
// f(x)
124
111
hasParent (expr (hasParent (cxxConstructExpr ())).bind (" use_parent" )),
125
-
126
112
// f((x))
127
113
hasParent (parenExpr (hasParent (
128
- expr (hasParent (cxxConstructExpr ())).bind (" use_parent" ))))
129
-
130
- )
131
-
132
- )
114
+ expr (hasParent (cxxConstructExpr ())).bind (" use_parent" ))))))
133
115
.bind (" use" ),
134
116
this );
135
117
}
You can’t perform that action at this time.
0 commit comments