File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -402,6 +402,8 @@ CTU::FileInfo *CTU::getFileInfo(const Tokenizer *tokenizer)
402402 argtok = addr ? addr : isReferenceArg (argtok);
403403 if (!argtok || argtok->values ().size () != 1U )
404404 continue ;
405+ if (argtok->variable () && argtok->variable ()->isClass ())
406+ continue ;
405407
406408 const ValueFlow::Value &v = argtok->values ().front ();
407409 if (v.valueType == ValueFlow::Value::ValueType::UNINIT && !v.isInconclusive ()) {
Original file line number Diff line number Diff line change @@ -6597,6 +6597,17 @@ class TestUninitVar : public TestFixture {
65976597 " return n;\n "
65986598 " }\n " );
65996599 ASSERT_EQUALS (" [test.cpp:4] -> [test.cpp:1]: (error) Using argument i that points at uninitialized variable n\n " , errout.str ());
6600+
6601+ ctu (" typedef struct { int type; int id; } Stem;\n "
6602+ " void lookupStem(recodeCtx h, Stem *stem) {\n "
6603+ " i = stem->type & STEM_VERT;\n "
6604+ " }\n "
6605+ " void foo() {\n "
6606+ " Stem stem;\n "
6607+ " stem.type = 0;\n "
6608+ " lookupStem(h, &stem);\n "
6609+ " }\n " );
6610+ ASSERT_EQUALS (" " , errout.str ());
66006611 }
66016612};
66026613
You can’t perform that action at this time.
0 commit comments