Fixed #4000, added support for function prototypes to TemplateSimplifier::templateParameters()
This commit is contained in:
parent
a15e307df0
commit
2ac2674f67
|
@ -209,9 +209,9 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok)
|
|||
while (Token::Match(tok, "*|&|const"))
|
||||
tok = tok->next();
|
||||
|
||||
// Function pointer..
|
||||
if (Token::simpleMatch(tok, "( * ) ("))
|
||||
tok = tok->linkAt(3)->next();
|
||||
// Function pointer or prototype..
|
||||
while (tok->str() == "(")
|
||||
tok = tok->link()->next();
|
||||
|
||||
// inner template
|
||||
if (tok->str() == "<") {
|
||||
|
|
|
@ -246,6 +246,7 @@ private:
|
|||
TEST_CASE(varid_unknown_macro); // #2638 - unknown macro is not type
|
||||
TEST_CASE(varid_using); // ticket #3648
|
||||
TEST_CASE(varid_catch);
|
||||
TEST_CASE(varid_functionPrototypeTemplate);
|
||||
|
||||
TEST_CASE(varidclass1);
|
||||
TEST_CASE(varidclass2);
|
||||
|
@ -3798,6 +3799,11 @@ private:
|
|||
ASSERT_EQUALS(expected, tokenizeDebugListing(code));
|
||||
}
|
||||
|
||||
void varid_functionPrototypeTemplate() {
|
||||
ASSERT_EQUALS("\n\n##file 0\n"
|
||||
"1: function < void ( ) > fptr@1 ;\n", tokenizeDebugListing("function<void(void)> fptr;"));
|
||||
}
|
||||
|
||||
void varidclass1() {
|
||||
const std::string actual = tokenizeDebugListing(
|
||||
"class Fred\n"
|
||||
|
|
Loading…
Reference in New Issue