Fixed #6586 (Tokenizer: '>>' is wrongly tokenized as '> >' - if (n1 < len>>1))
This commit is contained in:
parent
4644e2a9a6
commit
aacd9b9f6b
|
@ -305,7 +305,7 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok)
|
|||
// ,/>
|
||||
while (Token::Match(tok, ">|>>")) {
|
||||
if (level == 0)
|
||||
return numberOfParameters;
|
||||
return ((tok->str() == ">") ? numberOfParameters : 0);
|
||||
--level;
|
||||
if (tok->str() == ">>") {
|
||||
if (level == 0)
|
||||
|
|
|
@ -1150,6 +1150,7 @@ private:
|
|||
ASSERT_EQUALS(1U, templateParameters("<const int> x;"));
|
||||
ASSERT_EQUALS(1U, templateParameters("<int const *> x;"));
|
||||
ASSERT_EQUALS(1U, templateParameters("<const struct C> x;"));
|
||||
ASSERT_EQUALS(0U, templateParameters("<len>>x;"));
|
||||
}
|
||||
|
||||
void templateParameters1() {
|
||||
|
|
Loading…
Reference in New Issue