File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2085,6 +2085,8 @@ void CheckStl::string_c_str()
20852085 if (Token::Match (tok, " throw %var% . c_str|data ( ) ;" ) && isLocal (tok->next ()) &&
20862086 tok->next ()->variable () && tok->next ()->variable ()->isStlStringType ()) {
20872087 string_c_strThrowError (tok);
2088+ } else if (printPerformance && isc_strConstructor (tok)) {
2089+ string_c_strConstructor (tok, tok->variable ()->getTypeName ());
20882090 } else if (tok->variable ()) {
20892091 if (Token::Match (tok->tokAt (1 ), " = %var% . str ( ) . c_str|data ( ) ;" )) {
20902092 const Variable* var = tok->variable ();
@@ -2130,8 +2132,6 @@ void CheckStl::string_c_str()
21302132 }
21312133 }
21322134 }
2133- } else if (printPerformance && isc_strConstructor (tok)) {
2134- string_c_strConstructor (tok, tok->variable ()->getTypeName ());
21352135 } else if (printPerformance && isc_strConcat (tok)) {
21362136 string_c_strConcat (tok);
21372137 } else if (printPerformance && Token::simpleMatch (tok, " <<" ) && tok->astOperand2 () && Token::Match (tok->astOperand2 ()->astOperand1 (), " . c_str|data ( )" )) {
You can’t perform that action at this time.
0 commit comments