Skip to content

Commit 372ab7e

Browse files
committed
Fix
1 parent 1ce99c9 commit 372ab7e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/checkstl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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 ( )")) {

0 commit comments

Comments
 (0)