Fixed #8034 (AST: better handling for c++ type initialization)
This commit is contained in:
parent
5444875f89
commit
dda5556ded
|
@ -386,7 +386,7 @@ static bool iscast(const Token *tok)
|
|||
// int(1), int*(2), ..
|
||||
static Token * findCppTypeInitPar(Token *tok)
|
||||
{
|
||||
if (!tok || !Token::Match(tok->previous(), "[,(] %name%"))
|
||||
if (!tok || !Token::Match(tok->previous(), "[,()] %name%"))
|
||||
return nullptr;
|
||||
while (Token::Match(tok, "%name%|::|<")) {
|
||||
if (tok->str() == "<") {
|
||||
|
|
|
@ -7933,6 +7933,7 @@ private:
|
|||
// C++ : type()
|
||||
ASSERT_EQUALS("fint(0,(", testAst("f(int(),0);"));
|
||||
ASSERT_EQUALS("f(0,(", testAst("f(int *(),0);")); // typedef int* X; f(X(),0);
|
||||
ASSERT_EQUALS("f((0,(", testAst("f((intp)int *(),0);"));
|
||||
|
||||
// for
|
||||
ASSERT_EQUALS("for;;(", testAst("for(;;)"));
|
||||
|
|
Loading…
Reference in New Issue