From 6c05f78a8f918ffa9bd9c161f71fa9d354b93ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 31 Jul 2013 09:58:31 +0200 Subject: [PATCH] Reverted experimental changes for handling of lambda functions (#4919). --- lib/check64bit.cpp | 3 +-- test/test64bit.cpp | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/check64bit.cpp b/lib/check64bit.cpp index 01778b322..09beac543 100644 --- a/lib/check64bit.cpp +++ b/lib/check64bit.cpp @@ -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())) diff --git a/test/test64bit.cpp b/test/test64bit.cpp index a6a161f19..b2cdb612d 100644 --- a/test/test64bit.cpp +++ b/test/test64bit.cpp @@ -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()); } };