Fixed #5279 (False positive: warning (uninitMemberVar): Member variable 'ToDoubleArray::mfNaN' is not initialized in the constructor. (modified #5170 example))

This commit is contained in:
Alexander Mai 2014-01-01 18:34:39 +01:00 committed by Daniel Marjamäki
parent 14c8140536
commit 5539e9ea0f
2 changed files with 10 additions and 0 deletions

View File

@ -550,6 +550,8 @@ void CheckClass::initializeVarList(const Function &func, std::list<const Functio
ftok = ftok->tokAt(2); ftok = ftok->tokAt(2);
// Skip "classname :: " // Skip "classname :: "
if (Token::Match(ftok, ":: %var% "))
ftok = ftok->next();
while (Token::Match(ftok, "%var% ::")) while (Token::Match(ftok, "%var% ::"))
ftok = ftok->tokAt(2); ftok = ftok->tokAt(2);

View File

@ -1923,6 +1923,14 @@ private:
" }\n" " }\n"
"};"); "};");
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
check("class A {\n"
" double d;\n"
"public:\n"
" A() {\n"
" ::rtl::math::setNan(&d);\n"
" }\n"
"};");
ASSERT_EQUALS("", errout.str());
} }
void uninitVarArray1() { void uninitVarArray1() {