Fix #9383 ("debug: Function::addArguments found argument 'x' with varid 0." with variadic templates) (#2238)
This commit is contained in:
parent
3c085fd88a
commit
78b9fd9bb9
|
@ -3002,7 +3002,7 @@ static bool setVarIdParseDeclaration(const Token **tok, const std::map<std::stri
|
|||
bracket = true; // Skip: Seems to be valid pointer to array or function pointer
|
||||
} else if (tok2->str() == "::") {
|
||||
singleNameCount = 0;
|
||||
} else if (tok2->str() != "*" && tok2->str() != "::") {
|
||||
} else if (tok2->str() != "*" && tok2->str() != "::" && tok2->str() != "...") {
|
||||
break;
|
||||
}
|
||||
tok2 = tok2->next();
|
||||
|
|
|
@ -164,6 +164,7 @@ private:
|
|||
TEST_CASE(varid_lambda_mutable);
|
||||
TEST_CASE(varid_trailing_return1); // #8889
|
||||
TEST_CASE(varid_trailing_return2); // #9066
|
||||
TEST_CASE(varid_parameter_pack); // #9383
|
||||
|
||||
TEST_CASE(varidclass1);
|
||||
TEST_CASE(varidclass2);
|
||||
|
@ -2535,6 +2536,18 @@ private:
|
|||
ASSERT_EQUALS(exp1, tokenize(code1));
|
||||
}
|
||||
|
||||
void varid_parameter_pack() { // #9383
|
||||
const char code1[] = "template <typename... Rest>\n"
|
||||
"void func(Rest... parameters) {\n"
|
||||
" foo(parameters...);\n"
|
||||
"}\n";
|
||||
const char exp1[] = "1: template < typename ... Rest >\n"
|
||||
"2: void func ( Rest ... parameters@1 ) {\n"
|
||||
"3: foo ( parameters@1 ... ) ;\n"
|
||||
"4: }\n";
|
||||
ASSERT_EQUALS(exp1, tokenize(code1));
|
||||
}
|
||||
|
||||
void varidclass1() {
|
||||
const std::string actual = tokenize(
|
||||
"class Fred\n"
|
||||
|
|
Loading…
Reference in New Issue