This commit is contained in:
Robert Reif 2011-03-21 20:57:17 -04:00
parent dc0dfea079
commit c043e6e1a2
2 changed files with 15 additions and 1 deletions

View File

@ -3468,7 +3468,8 @@ void Tokenizer::setVarId()
tok2 = tok2->next();
again = true;
}
else if (level > 1 && Token::Match(tok2, "%type% *|&| >"))
else if (level > 1 && (Token::Match(tok2, "%type% *|&| >") ||
Token::Match(tok2, "%num% >")))
{
--level;
while (tok2->str() != ">")

View File

@ -171,6 +171,7 @@ private:
TEST_CASE(varid26); // ticket #1967 (list of function pointers)
TEST_CASE(varid27); // Ticket #2280 (same name for namespace and variable)
TEST_CASE(varid28); // ticket #2630
TEST_CASE(varid29); // ticket #1974
TEST_CASE(varidFunctionCall1);
TEST_CASE(varidFunctionCall2);
TEST_CASE(varidFunctionCall3);
@ -2830,6 +2831,18 @@ private:
ASSERT_EQUALS("", errout.str());
}
void varid29()
{
const std::string code("class A {\n"
" B<C<1>,1> b;\n"
"};\n");
const std::string expected("\n\n##file 0\n"
"1: class A {\n"
"2: B < C < 1 > , 1 > b@1 ;\n"
"3: } ;\n");
ASSERT_EQUALS(expected, tokenizeDebugListing(code));
}
void varidFunctionCall1()
{
const std::string code("void f() {\n"