Reverted experimental changes for handling of lambda functions (#4919).

This commit is contained in:
Daniel Marjamäki 2013-07-31 09:58:31 +02:00
parent 9656e71c03
commit 6c05f78a8f
2 changed files with 1 additions and 8 deletions

View File

@ -65,8 +65,7 @@ void Check64BitPortability::pointerassignment()
continue;
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
if (Token::Match(tok, "return %var%|%num% [;+]") && !Token::simpleMatch(tok, "return 0 ;") &&
(tok->scope() == scope)) { // #4919 - check if the 'return' doesn't belong to a lambda inside this 'scope'
if (Token::Match(tok, "return %var%|%num% [;+]") && !Token::simpleMatch(tok, "return 0 ;")) {
enum { NO, INT, PTR, PTRDIFF } type = NO;
for (const Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) {
if ((type == NO || type == INT) && Token::Match(tok2, "%var% [+;]") && isaddr(tok2->variable()))

View File

@ -193,12 +193,6 @@ private:
" return 1 + p->i;\n"
"}");
ASSERT_EQUALS("", errout.str());
// #4919
check("void* foo(int i) {\n"
" [i] { return i; };\n"
"}");
ASSERT_EQUALS("", errout.str());
}
};