File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1245,11 +1245,12 @@ void CheckClass::operatorEq()
12451245 }
12461246 if (!returnSelfRef) {
12471247 // make sure we really have a copy assignment operator
1248- if (Token::Match (func->tokenDef ->tokAt (2 ), " const| %name% &" )) {
1249- if (func->tokenDef ->strAt (2 ) == " const" &&
1250- func->tokenDef ->strAt (3 ) == scope->className )
1248+ const Token *paramTok = func->tokenDef ->tokAt (2 );
1249+ if (Token::Match (paramTok, " const| %name% &" )) {
1250+ if (paramTok->str () == " const" &&
1251+ paramTok->strAt (1 ) == scope->className )
12511252 operatorEqReturnError (func->retDef , scope->className );
1252- else if (func-> tokenDef -> strAt ( 2 ) == scope->className )
1253+ else if (paramTok-> str ( ) == scope->className )
12531254 operatorEqReturnError (func->retDef , scope->className );
12541255 }
12551256 }
You can’t perform that action at this time.
0 commit comments