Skip to content

Commit f10f3ab

Browse files
Update checkstl.cpp
1 parent 6602ba1 commit f10f3ab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checkstl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2328,7 +2328,7 @@ void CheckStl::uselessCalls()
23282328
!tok->tokAt(4)->astParent() &&
23292329
tok->next()->variable() && tok->next()->variable()->isStlType(stl_containers_with_empty_and_clear))
23302330
uselessCallsEmptyError(tok->next());
2331-
else if (Token::Match(tok, "[{};] std :: remove|remove_if|unique (") && tok->tokAt(5)->nextArgument())
2331+
else if (Token::Match(tok, "[{};] std :: remove|remove_if|unique (") && tok->tokAt(5)->nextArgument() && !tok->tokAt(4)->astParent())
23322332
uselessCallsRemoveError(tok->next(), tok->strAt(3));
23332333
else if (printPerformance && tok->valueType() && tok->valueType()->type == ValueType::CONTAINER) {
23342334
if (Token::Match(tok, "%var% = { %var% . begin ( ) ,") && tok->varId() == tok->tokAt(3)->varId())

0 commit comments

Comments
 (0)