Fixed #7823 (No varid for member variable of type std::bitset< static_cast<int>(2) >)

This commit is contained in:
Daniel Marjamäki 2017-11-05 17:59:34 +01:00
parent 511d14a051
commit 324257ef52
2 changed files with 11 additions and 3 deletions

View File

@ -314,9 +314,8 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok)
}
tok = tok->next();
// * / &
while (Token::Match(tok, "[*&]"))
tok = tok->next();
if (Token::simpleMatch(tok,"("))
tok = tok->link()->next();
if (!tok)
return 0;

View File

@ -99,6 +99,7 @@ private:
TEST_CASE(varidFunctionCall4); // ticket #3280
TEST_CASE(varidFunctionCall5);
TEST_CASE(varidStl);
TEST_CASE(varidStl2);
TEST_CASE(varid_newauto); // not declaration: new const auto(0);
TEST_CASE(varid_delete);
TEST_CASE(varid_functions);
@ -1157,6 +1158,14 @@ private:
ASSERT_EQUALS(expected, actual);
}
void varidStl2() {
const std::string actual = tokenize("std::bitset<static_cast<int>(2)> x;");
const char expected[] = "1: std :: bitset < static_cast < int > ( 2 ) > x@1 ;\n";
ASSERT_EQUALS(expected, actual);
}
void varid_newauto() {
ASSERT_EQUALS("1: void f ( ) { const new auto ( 0 ) ; }\n",
tokenize("void f(){new const auto(0);}"));