Fixed #2216 (wrong warning when C++0x keyword delete is used)

This commit is contained in:
Daniel Marjamäki 2010-11-20 17:20:25 +01:00
parent f10e433593
commit 0fe4249cfc
2 changed files with 8 additions and 1 deletions

View File

@ -2106,7 +2106,7 @@ bool Tokenizer::tokenize(std::istream &code,
tok2 = tok2->link()->previous();
// operator ==|>|<|..
if (Token::Match(tok->previous(), "operator %any%"))
if (Token::Match(tok2->previous(), "operator %any%"))
tok2 = tok2->previous();
else if (Token::simpleMatch(tok2->tokAt(-2), "operator [ ]"))
tok2 = tok2->tokAt(-2);

View File

@ -4282,6 +4282,13 @@ private:
ASSERT_EQUALS("struct A { }", tokenizeAndStringify(code));
}
{
const char *code = "struct A {"
" void operator = (void *) = delete;"
"}";
ASSERT_EQUALS("struct A { }", tokenizeAndStringify(code));
}
{
const char *code = "struct foo {"
" foo();"