Fixed #5170 (False positive: warning (uninitMemberVar): Member variable 'ToDoubleArray::mfNaN' is not initialized in the constructor.)
This commit is contained in:
parent
a948b4f4b0
commit
92305ed1f9
|
@ -550,7 +550,7 @@ void CheckClass::initializeVarList(const Function &func, std::list<const Functio
|
|||
ftok = ftok->tokAt(2);
|
||||
|
||||
// Skip "classname :: "
|
||||
if (Token::Match(ftok, "%var% ::"))
|
||||
while (Token::Match(ftok, "%var% ::"))
|
||||
ftok = ftok->tokAt(2);
|
||||
|
||||
// Clearing all variables..
|
||||
|
|
|
@ -121,6 +121,7 @@ private:
|
|||
TEST_CASE(uninitVar24); // ticket #3190
|
||||
TEST_CASE(uninitVar25); // ticket #4789
|
||||
TEST_CASE(uninitVar26);
|
||||
TEST_CASE(uninitVar27); // ticket #5170 - rtl::math::setNan(&d)
|
||||
TEST_CASE(uninitVarEnum);
|
||||
TEST_CASE(uninitVarStream);
|
||||
TEST_CASE(uninitVarTypedef);
|
||||
|
@ -1913,6 +1914,17 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void uninitVar27() {
|
||||
check("class A {\n"
|
||||
" double d;\n"
|
||||
"public:\n"
|
||||
" A() {\n"
|
||||
" rtl::math::setNan(&d);\n"
|
||||
" }\n"
|
||||
"};");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void uninitVarArray1() {
|
||||
check("class John\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue