typedef: fix testcase 4. ticket: #2375
This commit is contained in:
parent
63ad1fbe69
commit
a782d3ddf7
|
@ -1167,6 +1167,26 @@ void Tokenizer::simplifyTypedef()
|
|||
}
|
||||
}
|
||||
|
||||
// check for operator typedef
|
||||
/** @todo add support for multi-token operators */
|
||||
else if (tok2->str() == "operator" &&
|
||||
tok2->next()->str() == typeName->str() &&
|
||||
tok2->strAt(2) == "(" &&
|
||||
Token::Match(tok2->tokAt(2)->link(), ") const| {"))
|
||||
{
|
||||
// check for qualifier
|
||||
if (tok2->previous()->str() == "::")
|
||||
{
|
||||
// check for available and matching class name
|
||||
if (!spaceInfo.empty() && classLevel < spaceInfo.size() &&
|
||||
tok2->strAt(-2) == spaceInfo[classLevel].className)
|
||||
{
|
||||
tok2 = tok2->next();
|
||||
simplifyType = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check for member functions
|
||||
else if (Token::Match(tok2, ") const| {"))
|
||||
{
|
||||
|
|
|
@ -4751,7 +4751,7 @@ private:
|
|||
"operator int * * ( ) const ; "
|
||||
"} ; "
|
||||
"Fred :: operator int * * ( ) const { }";
|
||||
TODO_ASSERT_EQUALS(expected, sizeof_(code));
|
||||
ASSERT_EQUALS(expected, sizeof_(code));
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue