@@ -418,7 +418,7 @@ class TestValueFlow : public TestFixture {
418418
419419#define testLifetimeOfX (...) testLifetimeOfX_(__FILE__, __LINE__, __VA_ARGS__)
420420 template <size_t size>
421- bool testLifetimeOfX_ (const char * file, int line, const char (&code)[size], unsigned int linenr, const char value[], ValueFlow::Value::LifetimeScope lifetimeScope = ValueFlow::Value::LifetimeScope::Local ) {
421+ bool testLifetimeOfX_ (const char * file, int line, const char (&code)[size], unsigned int linenr, const char value[]) {
422422 // Tokenize..
423423 SimpleTokenizer tokenizer (settings, *this );
424424 ASSERT_LOC (tokenizer.tokenize (code), file, line);
@@ -427,7 +427,7 @@ class TestValueFlow : public TestFixture {
427427 for (const Token *tok = tokenizer.tokens (); tok; tok = tok->next ()) {
428428 if (tok->str () == " x" && tok->linenr () == linenr) {
429429 if (std::any_of (tok->values ().cbegin (), tok->values ().cend (), [&](const ValueFlow::Value& v) {
430- return v.isLifetimeValue () && v.lifetimeScope == lifetimeScope && Token::simpleMatch (v.tokvalue , value, len);
430+ return v.isLifetimeValue () && v.lifetimeScope == ValueFlow::Value::LifetimeScope::Local && Token::simpleMatch (v.tokvalue , value, len);
431431 }))
432432 return true ;
433433 }
@@ -546,11 +546,9 @@ class TestValueFlow : public TestFixture {
546546 int line,
547547 const char code[],
548548 const char tokstr[],
549- int value,
550- const Settings* s = nullptr ,
551- bool cpp = true )
549+ int value)
552550 {
553- std::list<ValueFlow::Value> values = removeImpossible (tokenValues_ (file, line, code, tokstr, s, cpp ));
551+ std::list<ValueFlow::Value> values = removeImpossible (tokenValues_ (file, line, code, tokstr));
554552 return std::any_of (values.begin (), values.end (), [&](const ValueFlow::Value& v) {
555553 return v.isKnown () && v.isIntValue () && v.intvalue == value;
556554 });
0 commit comments