Fixed false positive in stlBoundries check (#3740)

This commit is contained in:
PKEuS 2012-04-18 10:08:59 +02:00
parent c6f6194008
commit 1793bf8928
2 changed files with 7 additions and 1 deletions

View File

@ -695,7 +695,7 @@ void CheckStl::stlBoundries()
--indentlevel;
} else if (Token::Match(tok2, "!!* %varid% <", iteratorid)) {
stlBoundriesError(tok2, container_name);
} else if (Token::Match(tok2, "> %varid%", iteratorid)) {
} else if (Token::Match(tok2, "> %varid% !!.", iteratorid)) {
stlBoundriesError(tok2, container_name);
}
}

View File

@ -1137,6 +1137,12 @@ private:
"}\n");
ASSERT_EQUALS("", errout.str());
check("bool f() {\n"
" static set<Foo>::const_iterator current;\n"
" return 25 > current->bar;\n"
"}");
ASSERT_EQUALS("", errout.str());
}