@@ -112,29 +112,29 @@ void RedundantCastingCheck::registerMatchers(MatchFinder *Finder) {
112
112
unless (hasCastKind (CK_UserDefinedConversion)),
113
113
unless (cxxFunctionalCastExpr (hasDestinationType (unless (SimpleType)))),
114
114
115
- hasDestinationType (qualType ().bind (" type2 " )),
115
+ hasDestinationType (qualType ().bind (" dstType " )),
116
116
hasSourceExpression (anyOf (
117
117
expr (unless (initListExpr ()), unless (BitfieldMemberExpr),
118
- hasType (qualType ().bind (" type1 " )))
118
+ hasType (qualType ().bind (" srcType " )))
119
119
.bind (" source" ),
120
120
initListExpr (unless (hasInit (1 , expr ())),
121
121
hasInit (0 , expr (unless (BitfieldMemberExpr),
122
- hasType (qualType ().bind (" type1 " )))
122
+ hasType (qualType ().bind (" srcType " )))
123
123
.bind (" source" ))))))
124
124
.bind (" cast" ),
125
125
this );
126
126
}
127
127
128
128
void RedundantCastingCheck::check (const MatchFinder::MatchResult &Result) {
129
129
const auto *SourceExpr = Result.Nodes .getNodeAs <Expr>(" source" );
130
- auto TypeD = *Result.Nodes .getNodeAs <QualType>(" type2 " );
130
+ auto TypeD = *Result.Nodes .getNodeAs <QualType>(" dstType " );
131
131
132
132
if (SourceExpr->getValueKind () == VK_LValue &&
133
133
TypeD.getCanonicalType ()->isRValueReferenceType ())
134
134
return ;
135
135
136
136
const auto TypeS =
137
- Result.Nodes .getNodeAs <QualType>(" type1 " )->getNonReferenceType ();
137
+ Result.Nodes .getNodeAs <QualType>(" srcType " )->getNonReferenceType ();
138
138
TypeD = TypeD.getNonReferenceType ();
139
139
140
140
if (!areTypesEquals (TypeS, TypeD, IgnoreTypeAliases))
0 commit comments