Check64BitPortability::pointerassignment(): Skip over lambdas (#7451)
This commit is contained in:
parent
b65cacf4b1
commit
21b51dd235
@ -59,7 +59,7 @@ void Check64BitPortability::pointerassignment()
|
|||||||
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
|
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
|
||||||
// skip nested functions
|
// skip nested functions
|
||||||
if (tok->str() == "{") {
|
if (tok->str() == "{") {
|
||||||
if (tok->scope()->type == Scope::ScopeType::eFunction)
|
if (tok->scope()->type == Scope::ScopeType::eFunction || tok->scope()->type == Scope::ScopeType::eLambda)
|
||||||
tok = tok->link();
|
tok = tok->link();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,6 +209,14 @@ private:
|
|||||||
" } table;\n"
|
" } table;\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
// #7451: Lambdas
|
||||||
|
check("const int* test(std::vector<int> outputs, const std::string& text) {\n"
|
||||||
|
" auto it = std::find_if(outputs.begin(), outputs.end(), \n"
|
||||||
|
" [&](int ele) { return \"test\" == text; });\n"
|
||||||
|
" return nullptr;\n"
|
||||||
|
"}");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user