We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6602ba1 commit f10f3abCopy full SHA for f10f3ab
1 file changed
lib/checkstl.cpp
@@ -2328,7 +2328,7 @@ void CheckStl::uselessCalls()
2328
!tok->tokAt(4)->astParent() &&
2329
tok->next()->variable() && tok->next()->variable()->isStlType(stl_containers_with_empty_and_clear))
2330
uselessCallsEmptyError(tok->next());
2331
- else if (Token::Match(tok, "[{};] std :: remove|remove_if|unique (") && tok->tokAt(5)->nextArgument())
+ else if (Token::Match(tok, "[{};] std :: remove|remove_if|unique (") && tok->tokAt(5)->nextArgument() && !tok->tokAt(4)->astParent())
2332
uselessCallsRemoveError(tok->next(), tok->strAt(3));
2333
else if (printPerformance && tok->valueType() && tok->valueType()->type == ValueType::CONTAINER) {
2334
if (Token::Match(tok, "%var% = { %var% . begin ( ) ,") && tok->varId() == tok->tokAt(3)->varId())
0 commit comments