File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -700,7 +700,7 @@ void CheckStl::if_find()
700700
701701 if (printWarning && container->getYield (funcTok->str ()) == Library::Container::ITERATOR)
702702 if_findError (tok, false );
703- else if (printPerformance && container->stdStringLike )
703+ else if (printPerformance && container->stdStringLike && funcTok-> str () == " find " )
704704 if_findError (tok, true );
705705 } else if (printWarning && Token::Match (tok, " std :: find|find_if (" )) {
706706 // check that result is checked properly
Original file line number Diff line number Diff line change @@ -1726,6 +1726,12 @@ class TestStl : public TestFixture {
17261726 " if (foo(s.find(\" abc\" ))) { }\n "
17271727 " }" );
17281728 ASSERT_EQUALS (" " , errout.str ());
1729+
1730+ // #7349 - std::string::find_first_of
1731+ check (" void f(const std::string &s) {\n "
1732+ " if (s.find_first_of(\" abc\" )==0) { }\n "
1733+ " }" );
1734+ ASSERT_EQUALS (" " , errout.str ());
17291735 }
17301736
17311737
You can’t perform that action at this time.
0 commit comments